]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agofix locking within tcp_ipsec_pcbctl() to match ipsec4_pcbctl(), ipsec4_pcbctl()
sbruno [Wed, 4 Jul 2018 17:10:07 +0000 (17:10 +0000)]
fix locking within tcp_ipsec_pcbctl() to match ipsec4_pcbctl(), ipsec4_pcbctl()

IPSEC_PCBCTL() functions, which include tcp_ipsec_pcbctl(),
ipsec4_pcbctl(), and ipsec6_pcbctl(), should all have matching locking
semantics.

ipsec4_pcbctl() and ipsec6_pcbctl() expect the inp to be unlocked on
entry and exit and appear to be correctly implemented as such. But
tcp_ipsec_pcbctl() had other semantics. This patch fixes the semantics
for tcp_ipsec_pcbctl().

Submitted by: Jason Eggleston <jason@eggnet.com>
MFH: 2 weeks
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14623

5 years agoAdd description to debug.ncores sysctl.
oshogbo [Wed, 4 Jul 2018 17:06:51 +0000 (17:06 +0000)]
Add description to debug.ncores sysctl.

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D16123

5 years agoepoch(9): Fix man page typo
mmacy [Wed, 4 Jul 2018 17:06:23 +0000 (17:06 +0000)]
epoch(9): Fix man page typo

Submitted by: se
Reported by: se

5 years agoComplete my vertex even though edges were in place.
seanc [Wed, 4 Jul 2018 16:50:51 +0000 (16:50 +0000)]
Complete my vertex even though edges were in place.

Reported by: swills
Approved by: swills (mentor, implicit)

5 years agofix 335919 - check "last" not "inp" where appropriate
mmacy [Wed, 4 Jul 2018 16:34:07 +0000 (16:34 +0000)]
fix 335919 - check "last" not "inp" where appropriate

Submitted by: ae
Reported by: cy

5 years agomxge: fix panic at module unload
gallatin [Wed, 4 Jul 2018 14:25:38 +0000 (14:25 +0000)]
mxge: fix panic at module unload

r333175 (multicast changes) exposed a bug where
mxge was not checking to see if the driver was being
unloaded while handing ioctls that touch hardware.
As a result, now that in6m_disconnect() is run from
an async gtaskq, it was busy-waiting in mxge_send_cmd()
while the mcast list was destroyed.

5 years agoAdd a semaphore ping benchmark.
trasz [Wed, 4 Jul 2018 14:20:19 +0000 (14:20 +0000)]
Add a semaphore ping benchmark.

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

5 years agoAdd a very simple memcpy benchmark.
trasz [Wed, 4 Jul 2018 14:18:12 +0000 (14:18 +0000)]
Add a very simple memcpy benchmark.

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

5 years agoSort the benchmarks even more.
trasz [Wed, 4 Jul 2018 14:15:48 +0000 (14:15 +0000)]
Sort the benchmarks even more.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoRename "dup" and "fstat_shmfd" to "shmfd_dup" and "shmfd_fstat" for consistency.
trasz [Wed, 4 Jul 2018 14:14:00 +0000 (14:14 +0000)]
Rename "dup" and "fstat_shmfd" to "shmfd_dup" and "shmfd_fstat" for consistency.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoSort the benchmarks; no functional changes intended.
trasz [Wed, 4 Jul 2018 14:11:49 +0000 (14:11 +0000)]
Sort the benchmarks; no functional changes intended.

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

5 years agoDisable pipepingtd benchmarks, to make it not depend on libthr.
trasz [Wed, 4 Jul 2018 13:52:13 +0000 (13:52 +0000)]
Disable pipepingtd benchmarks, to make it not depend on libthr.

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

5 years agoMake the pipeping benchmarks work with larger buffer sizes.
trasz [Wed, 4 Jul 2018 13:45:29 +0000 (13:45 +0000)]
Make the pipeping benchmarks work with larger buffer sizes.

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

5 years agoAdd threaded pipe ping benchmark.
trasz [Wed, 4 Jul 2018 13:39:48 +0000 (13:39 +0000)]
Add threaded pipe ping benchmark.

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

5 years agomuge(4): remove DTB MAC addr from TODO list after r335925
emaste [Wed, 4 Jul 2018 13:38:02 +0000 (13:38 +0000)]
muge(4): remove DTB MAC addr from TODO list after r335925

Also replace numbered list with - bulleted so the list entries do not
need to be renumbered as tasks are completed.

Sponsored by: The FreeBSD Foundation

5 years agoAdd a trivial "pipe ping" (two processes) benchmark.
trasz [Wed, 4 Jul 2018 13:34:43 +0000 (13:34 +0000)]
Add a trivial "pipe ping" (two processes) benchmark.

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

5 years agoMake syscall_timing(1) build with WARNS=6.
trasz [Wed, 4 Jul 2018 13:31:55 +0000 (13:31 +0000)]
Make syscall_timing(1) build with WARNS=6.

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

5 years agoAdd setproctitle_fast(3) for frequent callers.
kib [Wed, 4 Jul 2018 13:31:16 +0000 (13:31 +0000)]
Add setproctitle_fast(3) for frequent callers.

Some applications, notably PostgreSQL, want to call setproctitle()
very often.  It's slow.  Provide an alternative cheap way of updating
process titles without making any syscalls, instead requiring other
processes (top, ps etc) to do a bit more work to retrieve the data.
This uses a pre-existing code path inherited from ancient BSD, which
always did it that way.

Submitted by: Thomas Munro
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16111

5 years agoAdd getprogname(3) (ie null) benchmark.
trasz [Wed, 4 Jul 2018 13:28:43 +0000 (13:28 +0000)]
Add getprogname(3) (ie null) benchmark.

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

5 years agotop: do not fall to the thread name if kernel cache of the process
kib [Wed, 4 Jul 2018 13:28:16 +0000 (13:28 +0000)]
top: do not fall to the thread name if kernel cache of the process
args is empty.

Instead, use kvm_getargv() unconditionally to obtain the process
arguments.  It means that one additional sysctl(2) is performed there.

Submitted by: Thomas Munro
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D16111

5 years agoUse a macro for iteration.
trasz [Wed, 4 Jul 2018 13:26:47 +0000 (13:26 +0000)]
Use a macro for iteration.

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

5 years agoAdd a way for the process to request cleanup of the kernel cache of
kib [Wed, 4 Jul 2018 13:22:48 +0000 (13:22 +0000)]
Add a way for the process to request cleanup of the kernel cache of
the process arguments.  New arguments length zero causes the drop of
the pargs instead of allocation of useless zero-length buffer.

Submitted by: Thomas Munro
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D16111

5 years agoremove unneeded inclusion of sys/interrupt.h from several files
avg [Wed, 4 Jul 2018 09:07:18 +0000 (09:07 +0000)]
remove unneeded inclusion of sys/interrupt.h from several files

It's likely that the header was needed in the past for swi(9).
But now that code does not use swi(9) or any other interfaces defined
in sys/interrupt.h.

MFC after: 1 week

5 years agoloader: fdt: Try to load every possible DTB from u-boot
manu [Wed, 4 Jul 2018 07:37:45 +0000 (07:37 +0000)]
loader: fdt: Try to load every possible DTB from u-boot

U-Boot setup a few variables :

 - fdt_addr which is the board static dtb (most of the time loaded before
   u-boot or coming from some hardware like a ROM)
 - fdt_addr_r which is a location in RAM that holds the DTB loaded by
   u-boot or before u-boot

In the case of u-boot + rpi firmware the DTB is loaded in RAM but the location
still end up in the fdt_addr variable and the fdt_addr_r variable exist.

Change the behavior so we test that a DTB exists for every possible variable :

 - fdt_addr_r is checked first as if u-boot needed to modify it the
   correct DTB will live there.
 - fdt_addr is checked second as if we run on a hardware with DTB in ROM
   it means that we what/need to run that
 - fdtaddr looks like a FreeBSD-ism but since I'm not sure leave it.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D16101

5 years ago- Fix a double unlock in inp_block_unblock_source() and
hrs [Wed, 4 Jul 2018 06:47:34 +0000 (06:47 +0000)]
- Fix a double unlock in inp_block_unblock_source() and
  lock leakage in inp_leave_group() which caused a panic.
- Make order of CTR1() and IN_MULTI_LIST_LOCK() consistent
  around inm_merge().

5 years agoepoch(9): update in_epoch() description as well
mmacy [Wed, 4 Jul 2018 03:54:39 +0000 (03:54 +0000)]
epoch(9): update in_epoch() description as well

5 years agoFreeBSD_version: update for epoch(9) r335924 KPI change
mmacy [Wed, 4 Jul 2018 03:46:23 +0000 (03:46 +0000)]
FreeBSD_version: update for epoch(9) r335924 KPI change

5 years agoepoch(9): update man page for r335924
mmacy [Wed, 4 Jul 2018 03:44:36 +0000 (03:44 +0000)]
epoch(9): update man page for r335924

5 years agoRevert r335833.
will [Wed, 4 Jul 2018 03:36:46 +0000 (03:36 +0000)]
Revert r335833.

Several third-parties use at least some of these ioctls.  While it would be
better for regression testing if they were used in base (or at least in the
test suite), it's currently not worth the trouble to push through removal.

Submitted by: antoine, markj

5 years agomuge(4): add DTB blob as one more possible source of MAC address
gonzo [Wed, 4 Jul 2018 03:02:53 +0000 (03:02 +0000)]
muge(4): add DTB blob as one more possible source of MAC address

On FDT-enabled platforms check if DTB blob has MAC address configured by
a boot loader. This information passed as a "local-mac-address" or
"mac-address" property of the device node. For USB NICs node
can be found by looking for compatibility string "usbVVV,PPP" where
VVV - vendor id (hex) and PPP - product id (hex)

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D16117

5 years agoepoch(9): allow preemptible epochs to compose
mmacy [Wed, 4 Jul 2018 02:47:16 +0000 (02:47 +0000)]
epoch(9): allow preemptible epochs to compose

- Add tracker argument to preemptible epochs
- Inline epoch read path in kernel and tied modules
- Change in_epoch to take an epoch as argument
- Simplify tfb_tcp_do_segment to not take a ti_locked argument,
  there's no longer any benefit to dropping the pcbinfo lock
  and trying to do so just adds an error prone branchfest to
  these functions
- Remove cases of same function recursion on the epoch as
  recursing is no longer free.
- Remove the the TAILQ_ENTRY and epoch_section from struct
  thread as the tracker field is now stack or heap allocated
  as appropriate.

Tested by: pho and Limelight Networks
Reviewed by: kbowling at llnw dot com
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16066

5 years agoMETA_MODE: Fix wanting a meta file in source tree.
bdrewery [Wed, 4 Jul 2018 00:18:40 +0000 (00:18 +0000)]
META_MODE: Fix wanting a meta file in source tree.

MFC after: 2 weeks
Sponsored by: Dell EMC

5 years agoUse OBJS_DEPEND_GUESS for forced opt_global.h dependency.
bdrewery [Wed, 4 Jul 2018 00:18:36 +0000 (00:18 +0000)]
Use OBJS_DEPEND_GUESS for forced opt_global.h dependency.

MFC after: 2 weeks
Sponsored by: Dell EMC

5 years agoAllow jail names (not just IDs) to be specified for: cpuset(1), ipfw(8),
jamie [Tue, 3 Jul 2018 23:47:20 +0000 (23:47 +0000)]
Allow jail names (not just IDs) to be specified for: cpuset(1), ipfw(8),
 sockstat(1), ugidfw(8)
These are the last of the jail-aware userland utilities that didn't work
 with names.

PR: 229266
MFC after: 3 days
Differential Revision: D16047

5 years agoopensolaris compat: fix compile error
mmacy [Tue, 3 Jul 2018 23:45:02 +0000 (23:45 +0000)]
opensolaris compat: fix compile error

when opensolaris/sys/types.h is included before stddef.h ptrdiff_t
would be typedef'd twice

5 years agoudp6_input: validate inpcb before use
mmacy [Tue, 3 Jul 2018 23:30:53 +0000 (23:30 +0000)]
udp6_input: validate inpcb before use

When traversing pcbinfo lists (rather than calling lookup) we need to
explicitly validate an inpcb before use.

5 years agodocument MODULE_TIED behavior change
mmacy [Tue, 3 Jul 2018 23:09:09 +0000 (23:09 +0000)]
document MODULE_TIED behavior change

5 years agoEnable MODULE_TIED by default for modules compiled with the kernel
mmacy [Tue, 3 Jul 2018 23:05:42 +0000 (23:05 +0000)]
Enable MODULE_TIED by default for modules compiled with the kernel

Requested by: jhb

5 years agoUse 'e' instead of 'i' constraints with 64-bit atomic operations on amd64.
jhb [Tue, 3 Jul 2018 22:03:28 +0000 (22:03 +0000)]
Use 'e' instead of 'i' constraints with 64-bit atomic operations on amd64.

The ADD, AND, OR, and SUB instructions take at most a 32-bit
sign-extended immediate operand.  64-bit constants that do not fit into
that constraint need to be loaded into a register.  The 'i' constraint
tells the compiler it can pass any integer constant to the assembler,
whereas the 'e' constrain only permits constants that fit into a 32-bit
sign-extended value.  This fixes using
atomic_add/clear/set/subtract_long/64 with constants that do not fit into
a 32-bit sign-extended immediate.

Reported by: several folks
Tested by: Pete Wright <pete@nomadlogic.org>
MFC after: 2 weeks

5 years agoFix .depend.foo.o tracking for sys/conf/files defined compilations.
bdrewery [Tue, 3 Jul 2018 21:29:04 +0000 (21:29 +0000)]
Fix .depend.foo.o tracking for sys/conf/files defined compilations.

Some example files:
  ia32_genassym.o
  acpi_wakecode.o

The old mkdep method also lacked tracking these files.

Objects defined in sys/conf/files with no-obj and no-implicit-rule get their
own targets defined in the kernel Makefile but lack having their objects added
to DEPENDOBJS so never get a .depend file generated.  Normally if an object is
in OBJS it will get a .depend file.

Fix this by looking for .o files in CLEAN and ensuring they are part of
the -MD filtering and .depend loading.  This is a hack.  Other solutions
could exist involving sys/conf/files or config(8) to auto add these to
DEPENDFILES/DEPENDOBJS but this method seems reliable enough without being
intrusive or error-prone for new files.

Reported by: bde
MFC after: 3 weeks
Sponsored by: Dell EMC

5 years agoNeed offset.inc generated early if MODULE_TIED is defined.
bdrewery [Tue, 3 Jul 2018 21:15:47 +0000 (21:15 +0000)]
Need offset.inc generated early if MODULE_TIED is defined.

5 years agoAll genassym.sh usage need offset.inc
bdrewery [Tue, 3 Jul 2018 21:02:25 +0000 (21:02 +0000)]
All genassym.sh usage need offset.inc

5 years agogenoffset.c is not generated
bdrewery [Tue, 3 Jul 2018 21:02:21 +0000 (21:02 +0000)]
genoffset.c is not generated

5 years agoFix r335906+r335907 to not pass multiple source files to genoffset_test.o target.
bdrewery [Tue, 3 Jul 2018 20:03:19 +0000 (20:03 +0000)]
Fix r335906+r335907 to not pass multiple source files to genoffset_test.o target.

This is working around a bug with the FAST_DEPEND logic with custom targets
that use .ALLSRC.

Reported by: mmacy

5 years agoHandle .depend for genoffset_test.o
bdrewery [Tue, 3 Jul 2018 19:24:52 +0000 (19:24 +0000)]
Handle .depend for genoffset_test.o

5 years agoNo need to make a copy to build genoffset_test.o
bdrewery [Tue, 3 Jul 2018 19:24:44 +0000 (19:24 +0000)]
No need to make a copy to build genoffset_test.o

5 years agorup: Fix -Wcast-align warnings
jilles [Tue, 3 Jul 2018 19:09:46 +0000 (19:09 +0000)]
rup: Fix -Wcast-align warnings

Fix possible strict aliasing issue (if time_t is the same size as int but
not int but for example long) which also resulted in a false positive
warning on systems with 64-bit time_t. Pointer casts are bad; we can just
copy the time_t.

Elsewhere, avoid casting char * to int * by using memcpy().

Reviewed by: eadler
Differential Revision: https://reviews.freebsd.org/D16075

5 years agoFix module build when MODULE_TIED=1 is set.
bdrewery [Tue, 3 Jul 2018 18:45:04 +0000 (18:45 +0000)]
Fix module build when MODULE_TIED=1 is set.

5 years agoexplain the purpose of genoffset_test
mmacy [Tue, 3 Jul 2018 18:39:43 +0000 (18:39 +0000)]
explain the purpose of genoffset_test

5 years agoensure that offset.inc is generated first
mmacy [Tue, 3 Jul 2018 18:20:42 +0000 (18:20 +0000)]
ensure that offset.inc is generated first

5 years agoRegen after 335900.
oshogbo [Tue, 3 Jul 2018 18:18:29 +0000 (18:18 +0000)]
Regen after 335900.

PR: 228671

5 years agocapsicum: add getdirentries to the freebsd32 compact
oshogbo [Tue, 3 Jul 2018 18:17:19 +0000 (18:17 +0000)]
capsicum: add getdirentries to the freebsd32 compact

There is a getdirentries syscall in freebsd32 and it's
capability ready so allow calling it in the capability mode.

PR: 228671

5 years agoauditd(8): register signal handlers interrutibly
asomers [Tue, 3 Jul 2018 17:37:16 +0000 (17:37 +0000)]
auditd(8): register signal handlers interrutibly

auditd_wait_for_events() relies on read(2) being interrupted by signals,
but it registers signal handlers with signal(3), which sets SA_RESTART.
That breaks asynchronous signal handling. It means that signals don't
actually get handled until after an audit(8) trigger is received.
Symptoms include:

* Sending SIGTERM to auditd doesn't kill it right away; you must send
  SIGTERM and then send a trigger with auditon(2).
* Same with SIGHUP
* Zombie child processes don't get reaped until auditd receives a trigger
  sent by auditon. This includes children created by expiring audit trails
  at auditd startup.

Fix by using sigaction(2) instead of signal(3).

Cherry pick https://github.com/openbsm/openbsm/commit/d060887

PR: 229381
Reviewed by: cem
Obtained from: OpenBSM
MFC after: 2 weeks
Differential Revision: https://github.com/openbsm/openbsm/pull/36

5 years agoClean up the vcs ID strings in libc's gen/ directory.
jhb [Tue, 3 Jul 2018 17:31:45 +0000 (17:31 +0000)]
Clean up the vcs ID strings in libc's gen/ directory.

- Move CSRG IDs into __SCCSID().
- When a file has been copied, consistently use 'From: <tag>' for strings
  referencing the version of the source file copied from in the license
  block comment.
- Some of the 'From:' tags were using $FreeBSD$ that was being expanded on
  each checkout.  Fix those to hardcode the FreeBSD tag from the file that
  was copied at the time of the copy.
- When multiple strings are present list them in "chronological" order,
  so CSRG (__SCCSID) before FreeBSD (__FBSDID).  If a file came from
  OtherBSD and contains a CSRG ID from the OtherBSD file, use the order
  CSRG -> OtherBSD -> FreeBSD.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D15831

5 years agoStrip __RCSID() and __SCCSID() strings by default when building libc.
jhb [Tue, 3 Jul 2018 16:45:49 +0000 (16:45 +0000)]
Strip __RCSID() and __SCCSID() strings by default when building libc.

This is in preparation for changes to update the various ID strings in
libc's source.  CSRG ID strings will use __SCCSID() and there are some
existing uses of __RCSID() for NetBSD ID strings already.  These are
generally under either an explicit #if 0 or an #ifdef LIBC_SCCS so are
off by default and this change preserves that existing behavior.

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

5 years agoReset indentiation of ata_suspend() such that its clear we fall through
sbruno [Tue, 3 Jul 2018 16:17:59 +0000 (16:17 +0000)]
Reset indentiation of ata_suspend() such that its clear we fall through
this function and that we aren't supposed to be controlled by the first
if() conditional.  Found with gcc.

No functional change is intended with this commit.

5 years agoFix the fstab entries for tests that have an efi partition in slice 1 and
ian [Tue, 3 Jul 2018 16:07:04 +0000 (16:07 +0000)]
Fix the fstab entries for tests that have an efi partition in slice 1 and
put the rootfs on s2.

5 years agoReset indentation of this flag. No functional change intended.
sbruno [Tue, 3 Jul 2018 15:56:22 +0000 (15:56 +0000)]
Reset indentation of this flag. No functional change intended.
Found with gcc.

sys/dev/ata/chipsets/ata-siliconimage.c: In function 'ata_cmd_ch_attach':
sys/dev/ata/chipsets/ata-siliconimage.c:187:5:
 warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (ctlr->chip->cfg2 & SII_INTR)
     ^~
sys/dev/ata/chipsets/ata-siliconimage.c:190:2:
note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  ch->flags |= ATA_NO_ATAPI_DMA;

5 years agoRevert 335888 ("Ensure va_list is declared by including stdarg.h.")
br [Tue, 3 Jul 2018 15:48:34 +0000 (15:48 +0000)]
Revert 335888 ("Ensure va_list is declared by including stdarg.h.")

The issue was caused by header pollution brought by GCC 8.1.

We now have to remove include-fixed headers in the GCC installation
directory.

Sponsored by: DARPA, AFRL
Pointed out by: jhb

5 years agoDon't specify the desired march/mabi for RISC-V in ACFLAGS.
jhb [Tue, 3 Jul 2018 15:24:09 +0000 (15:24 +0000)]
Don't specify the desired march/mabi for RISC-V in ACFLAGS.

ACFLAGS is only used in addition to CFLAGS, so setting the options in
both was redundant.  However, ACFLAGS is added to the command line
after CFLAGS, so the settings from ACFLAGS were applied for assembly
files in kernel modules after the kernel-specific march/abi in CFLAGS.
As a result, the hard-float ACFLAGS in bsd.cpu.mk was overriding the
soft-float CFLAGS.gcc in sys/conf/kern.mk.  In particular,
dtrace_asm.o was compiled as hard-float and the linker refused to link
dtrace.ko since its object files contained a mix of hard and soft
float.

Reviewed by: br
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D16054

5 years agoFix build: utf8strvisx() does signed data comparisons, but 'char' type
br [Tue, 3 Jul 2018 14:32:15 +0000 (14:32 +0000)]
Fix build: utf8strvisx() does signed data comparisons, but 'char' type
is unsigned in riscv GCC, so use guaranted signed char type.

Sponsored by: DARPA, AFRL

5 years agoo Ensure va_list is declared by including stdarg.h.
br [Tue, 3 Jul 2018 13:53:54 +0000 (13:53 +0000)]
o Ensure va_list is declared by including stdarg.h.
o Also move printf.h to go after it since it does require declaration
  of va_list.

This fixes build with latest RISC-V GNU Toolchain with GCC 8.1

Sponsored by: DARPA, AFRL

5 years agoAdd GCC 8.1.0 compiler warning flags.
br [Tue, 3 Jul 2018 10:51:59 +0000 (10:51 +0000)]
Add GCC 8.1.0 compiler warning flags.

Sponsored by: DARPA, AFRL

5 years agopfctl: Don't retrieve interface list if '-n' is set
kp [Tue, 3 Jul 2018 08:50:49 +0000 (08:50 +0000)]
pfctl: Don't retrieve interface list if '-n' is set

If '-n' is set we don't use the list of skip interfaces, so don't retrieve it.
This fixes issues if 'pfctl -n' is used before the pf module is loaded. This
was broken by r333181.

Reported by: Jakub Chromy <hicks AT cgi.cz>
MFC after: 1 week

5 years agoUpdate bsnmp to version 1.13. This does not bring user-visible changes.
harti [Tue, 3 Jul 2018 08:44:40 +0000 (08:44 +0000)]
Update bsnmp to version 1.13. This does not bring user-visible changes.
For developers gensnmptree can now generate functions for enums to convert
between enums and strings and to check the validity of a value.
The sources in FreeBSD are now in sync with the upstream which allows to
bring in IPv6 modifications.

5 years agoensure that offset.inc is generated before ia32_genassym.c is compiled
mmacy [Tue, 3 Jul 2018 05:56:23 +0000 (05:56 +0000)]
ensure that offset.inc is generated before ia32_genassym.c is compiled

5 years agostand/common/disk.c: dev->d_offset still needs to be set to 0
allanjude [Tue, 3 Jul 2018 05:53:27 +0000 (05:53 +0000)]
stand/common/disk.c: dev->d_offset still needs to be set to 0

With r335868, I thought this was no longer necessary. I was wrong.

Reported by: ian
Sponsored by: Klara Systems

5 years agoexpose sched_{pin,unpin}_lite to tied modules
mmacy [Tue, 3 Jul 2018 04:02:40 +0000 (04:02 +0000)]
expose sched_{pin,unpin}_lite to tied modules

5 years agoWhen toggling the display using the "m" command to toggle from 'cpu'
cy [Tue, 3 Jul 2018 02:54:32 +0000 (02:54 +0000)]
When toggling the display using the "m" command to toggle from 'cpu'
mode to 'io' mode, an artifact remains because the buffer is not
"finished" with a NULL terminator using sbuf_finish().

An example of this is, when the "m" command is entered, the title line
will contain COMMANDND instead of COMMAND. This commit fixes this.

5 years agoexpose thread_lite definition to tied modules
mmacy [Tue, 3 Jul 2018 02:50:07 +0000 (02:50 +0000)]
expose thread_lite definition to tied modules

5 years agomake critical_{enter, exit} inline
mmacy [Tue, 3 Jul 2018 01:55:09 +0000 (01:55 +0000)]
make critical_{enter, exit} inline

Avoid pulling in all of the <sys/proc.h> dependencies by
automatically generating a stripped down thread_lite exporting
only the fields of interest. The field declarations are type checked
against the original and the offsets of the generated result is
automatically checked.

kib has expressed disagreement and would have preferred to simply
use genassym style offsets (which loses type check enforcement).
jhb has expressed dislike of it due to header pollution and a
duplicate structure. He would have preferred to just have defined
thread in _thread.h. Nonetheless, he admits that this is the only
viable solution at the moment.

The impetus for this came from mjg's D15331:
"Inline critical_enter/exit for amd64"

Reviewed by: jeff
Differential Revision: https://reviews.freebsd.org/D16078

5 years agoDoh! Commit the proper default values, not my local tweaks.
ian [Mon, 2 Jul 2018 22:59:29 +0000 (22:59 +0000)]
Doh!  Commit the proper default values, not my local tweaks.

5 years agoMove the passphrase and iteration count into variables.
ian [Mon, 2 Jul 2018 22:58:04 +0000 (22:58 +0000)]
Move the passphrase and iteration count into variables.

This is purely to make it easier to tweak them locally; the machine I have
for testing takes forever to do 50,000 pw strengthening iterations, and
we're not testing the strength of geli's anti-pw-guessing logic here
(especially given that our test passphrase is "passphrase", except that
I tend to tweak that also, to 'x', because typing is hard).

Some day these should be settable as cmdline args.  But then, some day this
whole script should probably get a rewrite. :)

5 years agoAllow making just one flavor of boot-test image based on cmdline args.
ian [Mon, 2 Jul 2018 22:51:48 +0000 (22:51 +0000)]
Allow making just one flavor of boot-test image based on cmdline args.

5 years agoCut currdev dev and path fields for ZFS on the last colon.
mav [Mon, 2 Jul 2018 20:56:17 +0000 (20:56 +0000)]
Cut currdev dev and path fields for ZFS on the last colon.

Previously the code cut those fields on second colon, that prevented
boot from boot environments with colon in their names.  This change
moves the limitation from dev field to path, which is empty by default.

Reviewed by: allanjude, tsoome
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D16068

5 years agoinline atomics and allow tied modules to inline locks
mmacy [Mon, 2 Jul 2018 19:48:38 +0000 (19:48 +0000)]
inline atomics and allow tied modules to inline locks

- inline atomics in modules on i386 and amd64 (they were always
  inline on other arches)
- allow modules to opt in to inlining locks by specifying
  MODULE_TIED=1 in the makefile

Reviewed by: kib
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16079

5 years agoDocument the "#mds_path" suffix for the "-p" command line option.
rmacklem [Mon, 2 Jul 2018 19:33:26 +0000 (19:33 +0000)]
Document the "#mds_path" suffix for the "-p" command line option.

r335871 added support for an optional suffix of "#mds_path" that can be
applied to each entry in the "-p" option argument. This specifies that
the DS should be used to store files for the file system on the MDS
at "mds_path".
This patch documents this optional suffix.

This is a content change.

5 years agoAdd an optional feature to the pNFS server.
rmacklem [Mon, 2 Jul 2018 19:26:31 +0000 (19:26 +0000)]
Add an optional feature to the pNFS server.

Without this patch, the pNFS server distributes the data storage files across
all of the specified DSs.
A tester noted that it would be nice if a system administrator could control
which DSs are used to store the file data for a given exported MDS file system.
This patch adds an optional suffix for each entry in the "-p" option argument
that specifies "store file data for this MDS file system" in this DS.
The patch should only affect sites using the pNFS server (specified via the
"-p" command line option for nfsd.
The interface between the nfsd and the kernel has changed with this patch,
so anyone using the "-p" option needs to rebuild their nfsd from sources
with this patch applied to them.

Discussed with: james.rose@framestore.com

5 years agoAdd an optional feature to the pNFS server.
rmacklem [Mon, 2 Jul 2018 19:21:33 +0000 (19:21 +0000)]
Add an optional feature to the pNFS server.

Without this patch, the pNFS server distributes the data storage files across
all of the specified DSs.
A tester noted that it would be nice if a system administrator could control
which DSs are used to store the file data for a given exported MDS file system.
This patch adds the kernel support to do this. It also makes a slight semantic
change to nfsv4_findmirror(), since some uses of it no longer require that
the DS being searched for have a current mirror.
A patch that will be committed in a few minutes will modify the nfsd daemon
to support this feature.
The patch should only affect sites using the pNFS server (specified via the
"-p" command line option for nfsd.

Suggested by: james.rose@framestore.com

5 years agostand: uboot: Do not panic if we can't find a boot device
manu [Mon, 2 Jul 2018 18:23:43 +0000 (18:23 +0000)]
stand: uboot: Do not panic if we can't find a boot device

It is really anoying to panic when there is no boot device as you
cannot see the availables ones.

5 years agostand/common/disk.c: Read partition table relative to the start of the disk
allanjude [Mon, 2 Jul 2018 18:19:08 +0000 (18:19 +0000)]
stand/common/disk.c: Read partition table relative to the start of the disk

If a disk is of an oddball size, like the 200mb + 512b used in rootgen.sh,
when disk_open() is called on a GELI encrypted partition, attempts to read
the partition table fail, as they pass through the decryption process which
turns the already plaintext data into jibberish.

When reading the partition table, always pass a slice and partition setting
of -1, and an offset of 0. Setting the slice to -1 prevents a false
positive when checking the slice against the cache of GELI encrypted
slices.

Reviewed by: imp, ian
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D15847

5 years agoFix the server side krpc so that the kernel nfsd threads terminate.
rmacklem [Mon, 2 Jul 2018 17:50:46 +0000 (17:50 +0000)]
Fix the server side krpc so that the kernel nfsd threads terminate.

Occationally the kernel nfsd threads would not terminate when a SIGKILL
was posted for the kernel process (called nfsd (slave)). When this occurred,
the thread associated with the process (called "ismaster") had returned from
svc_run_internal() and was sleeping waiting for the other threads to terminate.
The other threads (created by kthread_start()) were still in svc_run_internal()
handling NFS RPCs.
The only way this could occur is for the "ismaster" thread to return from
svc_run_internal() without having called svc_exit().
There was only one place in the code where this could happen and this patch
stops that from happening.
Since the problem is intermittent, I cannot be sure if this has fixed the
problem, but I have not seen an occurrence of the problem with this patch
applied.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16087

5 years agoIntroduce vm_phys_enq_range(), and call it in vm_phys_alloc_npages()
alc [Mon, 2 Jul 2018 17:18:46 +0000 (17:18 +0000)]
Introduce vm_phys_enq_range(), and call it in vm_phys_alloc_npages()
and vm_phys_alloc_seg_contig() instead of vm_phys_free_contig().  In
short, vm_phys_enq_range() is simpler and faster than the more general
vm_phys_free_contig(), and in the case of vm_phys_alloc_seg_contig(),
vm_phys_free_contig() was placing the excess physical pages at the
wrong end of the queues.

In collaboration with: Doug Moore <dougm@rice.edu>

5 years agoChange the group and the permissions on /dev/acpi, to make "acpiconf"
trasz [Mon, 2 Jul 2018 14:15:30 +0000 (14:15 +0000)]
Change the group and the permissions on /dev/acpi, to make "acpiconf"
work when called by members of the 'operator' group. They are already
allowed to eg power off the system (via suid shutdown(8)), so they
might as well be permitted to suspend it.

Tested by: xmj@
Reviewed by: delphij@
MFC after: 2 weeks
Relnotes: yes
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16062

5 years agoDocument that syslogd -v has no effect when RFC 5424 mode is enabled.
ed [Mon, 2 Jul 2018 11:02:27 +0000 (11:02 +0000)]
Document that syslogd -v has no effect when RFC 5424 mode is enabled.

The variable it sets, LogFacPri, is only used in the RFC 3164 formatting
codepath.

PR: 229457
Reported by: Andre Albsmeier
MFC after: 1 week

5 years agoRestore the order in which RFC 3164 messages with fac/pri are formatted.
ed [Mon, 2 Jul 2018 10:57:22 +0000 (10:57 +0000)]
Restore the order in which RFC 3164 messages with fac/pri are formatted.

The refactoring of the syslogd code to format messages using iovecs
slightly altered the output of syslogd by placing the facility/priority
after the hostname, as opposed to printing it right before. This change
reverts the behaviour to be consistent with how it was before.

PR: 229457
Reported by: Andre Albsmeier
MFC after: 1 week

5 years agoAllow three digits of module id without breaking table alignment.
tuexen [Mon, 2 Jul 2018 09:14:00 +0000 (09:14 +0000)]
Allow three digits of module id without breaking table alignment.

5 years agoKeep table aligned when address pointer is not of max length.
tuexen [Mon, 2 Jul 2018 09:11:30 +0000 (09:11 +0000)]
Keep table aligned when address pointer is not of max length.

5 years agoImprove consistency of indentation. Whitespace change only.
tuexen [Mon, 2 Jul 2018 09:09:07 +0000 (09:09 +0000)]
Improve consistency of indentation. Whitespace change only.

5 years agoinpcb: don't gratuitously defer frees
mmacy [Mon, 2 Jul 2018 05:19:44 +0000 (05:19 +0000)]
inpcb: don't gratuitously defer frees

Don't defer frees in sysctl handlers. It isn't necessary
and it just confuses things.
revert: r333911, r334104, and r334125

Requested by: jtl

5 years ago[rpi] Add support for the second PWM channel
gonzo [Mon, 2 Jul 2018 01:30:33 +0000 (01:30 +0000)]
[rpi] Add support for the second PWM channel

Add support for the second channel to bcm2835_pwm driver. Configurable
parameters like mode, period, ratio are exposed as sysctls with postfix '2',
e.g.: dev.pwm.N.mode2, dev.pwm.N.period2, dev.pwm.N.ratio2

Second channel can be enabled in DTB by configuring pwn-2chan overlay
instead of pwm in config.txt. See [1]

[1] https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README

Submitted by: Bob Frazier
Differential Revision: https://reviews.freebsd.org/D15769

5 years ago[man] Get uhid(4) man page in sync with current API
gonzo [Sun, 1 Jul 2018 22:48:00 +0000 (22:48 +0000)]
[man] Get uhid(4) man page in sync with current API

API documented in previous version of uhid(4) man page has been obsolete
since May 2009 when old USB stack was replaced with USB2 implentation.
Current API has the same set of ioctl calls but uses usb_gen_descriptor
structure to pass data to/from kernel.

MFC after: 1 week

5 years agofind(1): use correct type for readlink
eadler [Sun, 1 Jul 2018 20:09:56 +0000 (20:09 +0000)]
find(1): use correct type for readlink

5 years agofind(1): deLINTify
eadler [Sun, 1 Jul 2018 20:09:52 +0000 (20:09 +0000)]
find(1): deLINTify

5 years agotop(1): permit infinite length for command
eadler [Sun, 1 Jul 2018 19:44:29 +0000 (19:44 +0000)]
top(1): permit infinite length for command

There isn't any need to limit the size of the screen. Utilities like
'less -S' don't have a (meaningful) limit anyways.  This also makes the
way to dynamically changing the column widths based on the screen width.

5 years agofind(1): remove portability ifdefs
eadler [Sun, 1 Jul 2018 19:44:26 +0000 (19:44 +0000)]
find(1): remove portability ifdefs

This code isn't designed to be particularly portable outside of FreeBSD.
To be more specific it doesn't make much sense to support compiling
find(1) on VMS.

5 years agoWith r335636 C++ program use libcasper.h and capsicum_helpers.h.
oshogbo [Sun, 1 Jul 2018 18:58:53 +0000 (18:58 +0000)]
With r335636 C++ program use libcasper.h and capsicum_helpers.h.
Add __BEGIN_DECLS and __END_DECLS to those headers.

5 years agopflog/pfsync: Fix module build with VIMAGE=yes
kp [Sun, 1 Jul 2018 18:09:16 +0000 (18:09 +0000)]
pflog/pfsync: Fix module build with VIMAGE=yes

pflog and pfsync's module Makefile fails to include opt_global.h to SRCS
leading to build error for VIMAGE case.

Reproduced with:
cd /usr/src/sys/modules/pflog && make VIMAGE=yes

PR: 229404
Submitted by: eugen@
MFC after: 1 week

5 years agoDocument the new "-m" command line option for pnfsdsfile(8).
rmacklem [Sun, 1 Jul 2018 17:51:52 +0000 (17:51 +0000)]
Document the new "-m" command line option for pnfsdsfile(8).

This is a content change.

5 years agoAdd a new "-m" option to pnfsdsfile(8) to prepare a file for mirroring.
rmacklem [Sun, 1 Jul 2018 17:49:02 +0000 (17:49 +0000)]
Add a new "-m" option to pnfsdsfile(8) to prepare a file for mirroring.

When pnfsdscopymr(8) is used to create a mirror of a file on a mirrored
pNFS service, it expects to find an entry in the extended attribute for
IP address 0.0.0.0.
This patch adds a "-m" option which can be used to create these entrie(s).
It also tightens up the checks for use of incompatible command line options.