]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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.

5 years agocore(5): overwrite the oldest core dump
oshogbo [Sun, 1 Jul 2018 17:28:46 +0000 (17:28 +0000)]
core(5): overwrite the oldest core dump

The '%I' format in the kern.corefile sysctl limits the number of
core files that a process can generate to the number stored in the
debug.ncores sysctl. The '%I' format is replaced by the single digit
index. Previously, if all indexes were taken the kernel would overwrite
only a core file with the highest index in a filename.
Currently the system will create a new core file if there is a free
index or if all slots are taken it will overwrite the oldest one.

Reviewed by: kib(code), bcr (updating)
Differential Revision: https://reviews.freebsd.org/D15991
Differential Revision: https://reviews.freebsd.org/D16084

5 years agoAdd basic examples to portsnap(8).
trasz [Sun, 1 Jul 2018 16:18:38 +0000 (16:18 +0000)]
Add basic examples to portsnap(8).

MFC after: 2 weeks

5 years agoaudit(4): add tests for procctl(2)
asomers [Sun, 1 Jul 2018 16:05:50 +0000 (16:05 +0000)]
audit(4): add tests for procctl(2)

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

5 years agocarp: Minor language improvements in the man page
kp [Sun, 1 Jul 2018 15:17:53 +0000 (15:17 +0000)]
carp: Minor language improvements in the man page

Submitted by: Massimiliano Stucchi <max AT stucchi.ch>

5 years agoIgnore _.universe-toolchain file.
bdrewery [Sun, 1 Jul 2018 13:50:37 +0000 (13:50 +0000)]
Ignore _.universe-toolchain file.

MFC after: 3 weeks
X-MFC-with: r335711

5 years ago`make installworld' should display "completed" message if done
wosch [Sun, 1 Jul 2018 10:05:45 +0000 (10:05 +0000)]
`make installworld' should display "completed" message if done

PR:             225159
Reviewed by:    bdrewery
Approved by:    cem (mentor)
Differential Revision:  https://reviews.freebsd.org/D14057

5 years agocarp: Set DSCP value CS7
kp [Sun, 1 Jul 2018 08:37:07 +0000 (08:37 +0000)]
carp: Set DSCP value CS7

Update carp to set DSCP value CS7(Network Traffic) in the flowlabel field of
packets by default. Currently carp only sets TOS_LOWDELAY in IPv4 which was
deprecated in 1998. This also implements sysctl that can revert carp back to
it's old behavior if desired.

This will allow implementation of QOS on modern network devices to make sure
carp packets aren't dropped during interface contention.

Submitted by: Nick Wolff <darkfiberiru AT gmail.com>
Reviewed by: kp, mav (earlier version)
Differential Revision: https://reviews.freebsd.org/D14536

5 years agotop(1) - support UTF-8 display
daichi [Sun, 1 Jul 2018 05:32:03 +0000 (05:32 +0000)]
top(1) - support UTF-8 display

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

5 years agopf(4): remove reference to non-existent pflow(4).
will [Sun, 1 Jul 2018 01:56:40 +0000 (01:56 +0000)]
pf(4): remove reference to non-existent pflow(4).

5 years agoMention, belatedly, the need to run mergemaster. This somehow
imp [Sun, 1 Jul 2018 01:45:41 +0000 (01:45 +0000)]
Mention, belatedly, the need to run mergemaster. This somehow
wasn't committed with the other changes.

5 years agopf: remove unused ioctls.
will [Sun, 1 Jul 2018 01:16:03 +0000 (01:16 +0000)]
pf: remove unused ioctls.

Several ioctls are unused in pf, in the sense that no base utility
references them.  Additionally, a cursory review of pf-based ports
indicates they're not used elsewhere either.  Some of them have been
unused since the original import.  As far as I can tell, they're also
unused in OpenBSD.  Finally, removing this code removes the need for
future pf work to take them into account.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D16076

5 years agoRather belatedly add myself to committers-src.dot.
will [Sun, 1 Jul 2018 01:11:32 +0000 (01:11 +0000)]
Rather belatedly add myself to committers-src.dot.

5 years agobeinstall: enable use with git worktrees.
will [Sun, 1 Jul 2018 01:09:52 +0000 (01:09 +0000)]
beinstall: enable use with git worktrees.

5 years agoin6_pcblookup_hash: validate inp for liveness
mmacy [Sun, 1 Jul 2018 01:01:59 +0000 (01:01 +0000)]
in6_pcblookup_hash: validate inp for liveness

5 years agoMETA_MODE: Fix clang-tblgen flip-flop building after r335707.
bdrewery [Sat, 30 Jun 2018 19:36:02 +0000 (19:36 +0000)]
META_MODE: Fix clang-tblgen flip-flop building after r335707.

The build of this would have MK_LLVM_TARGET_ALL=yes for bootstrap-tools
but MK_LLVM_TARGET_ALL=no for cross-tools and thus would rebuild between
the two.

MFC after: 2 weeks
X-MFC-with: r335707
Sponsored by: Dell EMC

5 years agoascii art fixed.
maxim [Sat, 30 Jun 2018 18:18:41 +0000 (18:18 +0000)]
ascii art fixed.

5 years agoMore follow-up to r335799 (llvm/clang 6.0.1 update), where I forgot to
dim [Sat, 30 Jun 2018 15:03:22 +0000 (15:03 +0000)]
More follow-up to r335799 (llvm/clang 6.0.1 update), where I forgot to
update mtree files, ObsoleteFiles and a number of other paths.  Sorry
about all the breakage.

Pointy hat to: me
MFC after: 2 weeks
X-MFC-With: r335799

5 years agopfsync: Fix state sync during initial bulk update
kp [Sat, 30 Jun 2018 12:51:08 +0000 (12:51 +0000)]
pfsync: Fix state sync during initial bulk update

States learned via pfsync from a peer with the same ruleset checksum were not
getting assigned to rules like they should because pfsync_in_upd() wasn't
passing the PFSYNC_SI_CKSUM flag along to pfsync_state_import.

PR: 229092
Submitted by: Kajetan Staszkiewicz <vegeta tuxpowered.net>
Obtained from: OpenBSD
MFC after: 1 week
Sponsored by: InnoGames GmbH

5 years agoAdd a safety belt assignment to the nfsd for when "-p" isn't specified.
rmacklem [Sat, 30 Jun 2018 12:14:20 +0000 (12:14 +0000)]
Add a safety belt assignment to the nfsd for when "-p" isn't specified.

The kernel code assumes that nfsdargs.addr == NULL and nfsdargs.addrlen == 0
when there is no "-p" argument used for starting the nfsd.
This small patch ensures this is the case. In practice, I believe this always
happened, since "nfsdargs" was the last element on the stack for "main()",
but this little patch ensures it will be the case.
Spotted by inspection while adding a new optional field for "-p".

5 years agoFollow-up to r335799 (llvm/clang 6.0.1 update), by regenerating various
dim [Sat, 30 Jun 2018 10:04:44 +0000 (10:04 +0000)]
Follow-up to r335799 (llvm/clang 6.0.1 update), by regenerating various
headers with new version information defines.

MFC after: 2 weeks
X-MFC-With: r335799

5 years agoiwn: Add the missing IWN_SDID_6035_5 subdevice
eadler [Sat, 30 Jun 2018 04:30:08 +0000 (04:30 +0000)]
iwn: Add the missing IWN_SDID_6035_5 subdevice

Obtained from: Haiku (da166fc6469b98397de98a7ccc13b82a3cd3b290)

5 years agobsd-family-tree: Announce DragonFly version 5.2.2
eadler [Sat, 30 Jun 2018 01:04:37 +0000 (01:04 +0000)]
bsd-family-tree: Announce DragonFly version 5.2.2

Obtained from: https://www.dragonflybsd.org/release52/

5 years agobsd-family-tree: Announce DragonFly version 5.2.2
eadler [Sat, 30 Jun 2018 01:02:59 +0000 (01:02 +0000)]
bsd-family-tree: Announce DragonFly version 5.2.2

Obtained from: https://www.dragonflybsd.org/release52/

5 years agoMFV: r335802
jkim [Fri, 29 Jun 2018 23:48:30 +0000 (23:48 +0000)]
MFV: r335802

Merge ACPICA 20180629.

5 years agoCreate um_flags in the ufsmount structure to hold flags for a UFS filesystem.
mckusick [Fri, 29 Jun 2018 22:24:41 +0000 (22:24 +0000)]
Create um_flags in the ufsmount structure to hold flags for a UFS filesystem.
Convert integer structure flags to use um_flags:

int um_candelete; /* devvp supports TRIM */
int um_writesuspended; /* suspension in progress */

become:

#define UM_CANDELETE 0x00000001 /* devvp supports TRIM */
#define UM_WRITESUSPENDED 0x00000002 /* suspension in progress */

This is in preparation for adding other flags to indicate forcible
unmount in progress after a disk failure and possibly forcible
downgrade to read-only.

No functional change intended.

Sponsored by: Netflix

5 years agoDon't change directory owner to root when building with -DNO_ROOT
arichardson [Fri, 29 Jun 2018 21:15:26 +0000 (21:15 +0000)]
Don't change directory owner to root when building with -DNO_ROOT

Currently the mtree calls in Makefile.inc1 all change the directory owner
to match the spec file. However, we should not be doing this during
distributeworld if -DNO_ROOT is passed. Additionally, when creating the
WORLDTMP directory hierachy there is no need to change the owner to root so
we now always pass the -W flag when populating WORLDTMP.

This is also required for building FreeBSD on Linux/Mac since the required
groups/users will not exist there which is how I discovered this issue.

Reviewed By: emaste, bdrewery, imp
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D14185

5 years agoFix missing files in METALOG with -DNO_ROOT
arichardson [Fri, 29 Jun 2018 21:15:17 +0000 (21:15 +0000)]
Fix missing files in METALOG with -DNO_ROOT

By using INSTALL_LINK instead of calling ln during install the files
end up in the METALOG file as well if we use -DNO_ROOT and will be
included in a disk image when using makefs with METALOG as the input.
The other file that was not included in METALOG was /var/db/services.db
which is now also included for -DNO_ROOT.

Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D15665

5 years agoSupport multiple OPAL consoles, and don't crash if uart is not stdout
jhibbits [Fri, 29 Jun 2018 19:35:25 +0000 (19:35 +0000)]
Support multiple OPAL consoles, and don't crash if uart is not stdout

Summary: If the chosen console is not the OPAL uart, but OPAL uart devices
exist, the console device doesn't attach properly, and faults in the interrupt
handler, with a NULL pointer dereference.  To fix this, and as a byproduct, also
support multiple OPAL consoles, refactor to have the console getc callback use
the appropriate softc instead of the global console_sc, which may be NULL in the
case of a different device being the console.

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

5 years agonewvers.sh: avoid possibly invalid relative directory
emaste [Fri, 29 Jun 2018 18:45:29 +0000 (18:45 +0000)]
newvers.sh: avoid possibly invalid relative directory

Previously newvers.sh passed --work-tree=${VCSDIR}/.. when invoking git.
When using git worktree .git is actually a file, not a directory, and
.git/.. is not a valid path.  Although it appears git handles this
internally (perhaps it normalizes the path first), it is simple enough
for the script to store both the working tree top-level directory and
the VCS (.git) directory, so do so.

Sponsored by: The FreeBSD Foundation

5 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
dim [Fri, 29 Jun 2018 17:51:35 +0000 (17:51 +0000)]
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
6.0.1 release (upstream r335540).

Relnotes: yes
MFC after: 2 weeks

5 years agoCorrect link metadata created when installing with -DNO_ROOT.
brooks [Fri, 29 Jun 2018 16:07:56 +0000 (16:07 +0000)]
Correct link metadata created when installing with -DNO_ROOT.

Explicitly specify owner/group/mode metadata when creating links.

More consistently use INSTALL_SYMLINK to install symlinks.

Reviewed by: bdrewery
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11231

5 years agor335795 build fix: make static functions static
emaste [Fri, 29 Jun 2018 14:51:36 +0000 (14:51 +0000)]
r335795 build fix: make static functions static

-Werror,-Wmissing-prototypes makes this an error otherwise.

MFC with: 335795
Sponsored by: The FreeBSD Foundation

5 years agoMake debug output produced by `setkey -x` command a more human readable.
ae [Fri, 29 Jun 2018 13:59:33 +0000 (13:59 +0000)]
Make debug output produced by `setkey -x` command a more human readable.

Add text names of SADB message types and extension headers to the output.

Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D16036

5 years agoFix the pNFS server for a case where mirror level equals number of DSs.
rmacklem [Fri, 29 Jun 2018 12:41:36 +0000 (12:41 +0000)]
Fix the pNFS server for a case where mirror level equals number of DSs.

If a pNFS service was set up where the number of DSs equals the mirror level
and then a DS was disabled, the service would create files with duplicate
entries for the same DS. This bug occurred because I didn't realize that
TAILQ_FOREACH_FROM() would start at the beginning of the list when the
inital value of the variable was NULL.
This patch also changes the pNFS server DS file creation code so that it
creates entrie(s) with 0.0.0.0 IP address when it cannot create mirror level
files due to lack of DSs.
The patch only affects the pNFS service and only when it was created with
a number of DSs equal to the mirror level and mirroring is enabled.

5 years agoInclude UART driver since it is now provided in QEMU.
br [Fri, 29 Jun 2018 10:55:42 +0000 (10:55 +0000)]
Include UART driver since it is now provided in QEMU.

Sponsored by: DARPA, AFRL

5 years agoaudit(4): add tests for several more administrative syscalls
asomers [Fri, 29 Jun 2018 04:52:27 +0000 (04:52 +0000)]
audit(4): add tests for several more administrative syscalls

Includes ntp_adjtime, auditctl, acct, auditon, and clock_settime.  Includes
quotactl, mount, nmount, swapon, and swapoff in failure mode only.  Success
tests for those syscalls will follow.  Also includes reboot(2) in failure
mode only.  That one can't be tested in success mode.

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

5 years agoaudit(4): add tests for setsid, wait4, wait6, and kill
asomers [Fri, 29 Jun 2018 04:46:15 +0000 (04:46 +0000)]
audit(4): add tests for setsid, wait4, wait6, and kill

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

5 years agoThree changes to vm_phys_alloc_seg_contig():
alc [Fri, 29 Jun 2018 04:08:14 +0000 (04:08 +0000)]
Three changes to vm_phys_alloc_seg_contig():

1. Optimize the order computation.

2. Update the pool for all of the chunks that are removed from the free
   page lists, and not just the first chunk.

3. Simplify the code for returning excess pages to the free page lists.

Reviewed by: Doug Moore <dougm@rice.edu>