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

5 years agoFix unknown target check after r335450.
bdrewery [Thu, 28 Jun 2018 22:24:16 +0000 (22:24 +0000)]
Fix unknown target check after r335450.

X-MFC-with: r335450
Pointyhat to: bdrewery
Sponsored by: Dell EMC

5 years agoWhen being verbose about various leapfile versions, also mention expiration.
ian [Thu, 28 Jun 2018 22:13:32 +0000 (22:13 +0000)]
When being verbose about various leapfile versions, also mention expiration.

The expiration date is actually more of a version number than the version
date, because expiration changes twice a year, whereas the version only
changes when actual leap second events occur (except in USNO leapfiles,
which inappropriately bump the version with every expiration date change).

5 years agoRename variable ntp_tmp_leapfile to have a leading underbar, to distinguish
ian [Thu, 28 Jun 2018 22:05:29 +0000 (22:05 +0000)]
Rename variable ntp_tmp_leapfile to have a leading underbar, to distinguish
it from variables with similar names which are set in rc.conf.  This will
make more sense as the script grows more similar-name local variables in
some upcoming changes.

5 years agoiwn: Correct Centrino Advanced-N 6235 constants
eadler [Thu, 28 Jun 2018 21:59:45 +0000 (21:59 +0000)]
iwn: Correct Centrino Advanced-N 6235 constants

The iwn 6235 is a 2x2 device (see
https://ark.intel.com/products/66890/Intel-Centrino-Advanced-N-6235-Dual-Band)

Reviewed by: adrian, kevans
Obtained from: Haiku

5 years agoInvalidate the mapping before updating its physical address.
markj [Thu, 28 Jun 2018 21:40:31 +0000 (21:40 +0000)]
Invalidate the mapping before updating its physical address.

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

With this change we can reuse the PV entry from the old mapping,
potentially avoiding a call to reclaim_pv_chunk().  Otherwise, there is
nothing preventing the old PV entry from being reclaimed.  In rare
cases this could result in the PTE's page table page being freed,
leading to a use-after-free of the page when the updated PTE is written
following the allocation of the PV entry for the new mapping.

Reported and tested by: pho
Reviewed by: alc, kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D16005

5 years agoSupport 2GB of memory on Malta systems with FreeBSD/mips.
jhb [Thu, 28 Jun 2018 21:27:34 +0000 (21:27 +0000)]
Support 2GB of memory on Malta systems with FreeBSD/mips.

When 2GB of memory is enabled for QEMU's Malta emulation, the physical
memory ends at an address of 2^32 - 1.  This causes an integer overflow
to zero when computing the upper bound of the second phys_avail[] range.
As a result, FreeBSD/mips kernels were only using the first 256MB of
RAM and ignoring the remaining 1.75GB.  To work around this, truncate
the extended memory size to 2GB minus one page for 32-bit mips kernels.

Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D16027

5 years agoRemove the various build flag hacks for GCC cross-compile.
jhb [Thu, 28 Jun 2018 21:26:14 +0000 (21:26 +0000)]
Remove the various build flag hacks for GCC cross-compile.

The xtoolchain GCC packages have not required these flags since ports
commits r465416 and r466701.  The in-tree GCC 4.2.1 has also been patched
in r335716 and r335717 to correctly honor --sysroot when looking for
includes and libraries.

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

5 years ago[rpi] Add SDHOST device driver for Raspberry Pi
gonzo [Thu, 28 Jun 2018 21:14:33 +0000 (21:14 +0000)]
[rpi] Add SDHOST device driver for Raspberry Pi

SDHOST is another SD controller that is present on Raspberry Pi (the
other one is SDHC and handled by bcm2835_sdhci driver). Both
controllers are capable of providing interface to SD card, actual
configuration can be set in dtb file. At the moment custom DTBs for
RPi/RPi2 have sdhost node disabled. On RPi3 sdhost is disabled in
snapshot images by applying mmc.dtbo overlay. To enalbe both devices
user has to edit config.txt on FAT partition and remove or comment
"dtoverlay=mmc" line.

When no overlay applied on RPi3 SDHOST controls SD card and SDHC
interface can be used for SDIO. mmc.dtbo overlay disables SDHOST node
and switches SD card over to SDHC.  Likewise sdhost.dtbo overlay (not
currently included in snapshot image, but can be obtained from firmare
repo[1]) disabled SDHC node and switch SD card over to SDHOST.

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

Submitted by: Klaus P. Ohrhallinger <k@7he.at>
Differential Revision: https://reviews.freebsd.org/D14168

5 years agoFix compilation error in r335765 under gcc 4.2.1.
dab [Thu, 28 Jun 2018 20:37:17 +0000 (20:37 +0000)]
Fix compilation error in r335765 under gcc 4.2.1.

The anonymous object initialization introduced in r335765 was
acceptable to clang, but not gcc 4.2.1. Fix it for both.

Reported by: jhibbits@
Pointy Hat: myself
MFC after: 1 week
X-MFC-with: r335765
Sponsored by: Dell EMC

5 years agoAdd stub arm64 linuxulator VDSO ldscript
emaste [Thu, 28 Jun 2018 20:36:21 +0000 (20:36 +0000)]
Add stub arm64 linuxulator VDSO ldscript

This needs to be revisited with the VDSO implementation, but is
sufficient to allow the linux64 module to build on arm64 for testing
and development.

Sponsored by: Turing Robotic Industries

5 years agoRevert preference to be an int.
imp [Thu, 28 Jun 2018 19:42:10 +0000 (19:42 +0000)]
Revert preference to be an int.

While in base we use it as a boolean (of the wrong spelling), there's
at least one out of tree user that needs it to be int since priorirty
is a small int, not a 0/1. In deference to the time it's wasted me and
my team, push this up into FreeBSD for whatever short life boot1 may
have in the tree.

5 years agoSYSTEM_COMPILER/LINKER: Fix cross-build support after r335706.
bdrewery [Thu, 28 Jun 2018 19:01:53 +0000 (19:01 +0000)]
SYSTEM_COMPILER/LINKER: Fix cross-build support after r335706.

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

5 years agotinderbox: If the clang lookup fails fallback to the old default behavior.
bdrewery [Thu, 28 Jun 2018 18:22:20 +0000 (18:22 +0000)]
tinderbox: If the clang lookup fails fallback to the old default behavior.

This fixes errors from the MK_CLANG_BOOTSTRAP/MK_LLD_BOOTSTRAP lookups
to not force using XCC/XLD but to rather just build them as normal by
allowing their own bootstrap logic to work.

MFC after: 3 weeks
X-MFC-with: r335711 r335769
Sponsored by: Dell EMC

5 years agoInclude existing MAKE_PARAMS_<target> when determining the universe toolchain.
jhb [Thu, 28 Jun 2018 18:19:46 +0000 (18:19 +0000)]
Include existing MAKE_PARAMS_<target> when determining the universe toolchain.

This fixes a warning for each RISCV target during universe by passing in
the required CROSS_TOOLCHAIN setting which will in turn set
CROSS_BINUTILS_PREFIX correctly.  It also ensures that a tinderbox build
uses the correct compiler for riscv.  Previously it was using the shared
clang compiler instead of riscv64-gcc.

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

5 years agosigaction.2: Minor cleanups
cem [Thu, 28 Jun 2018 18:17:20 +0000 (18:17 +0000)]
sigaction.2: Minor cleanups

Add vertical space between struct definition and function prototype.

Use "NULL" to describe zero pointers, instead of "zero."

Remove perhaps unclear "can not" and replace.  Tag struct member names used
with appropriate tags.

5 years agoReflow one of the comments describing vm_phys_alloc_npages().
alc [Thu, 28 Jun 2018 17:52:06 +0000 (17:52 +0000)]
Reflow one of the comments describing vm_phys_alloc_npages().

5 years agoAdd missing MODULE_VERSION() and MODULE_DEPEND().
ian [Thu, 28 Jun 2018 17:07:20 +0000 (17:07 +0000)]
Add missing MODULE_VERSION() and MODULE_DEPEND().

5 years agoRemove potential identifier conflict in the EV_SET macro.
dab [Thu, 28 Jun 2018 17:01:04 +0000 (17:01 +0000)]
Remove potential identifier conflict in the EV_SET macro.

PR43905 pointed out a problem with the EV_SET macro if the passed
struct kevent pointer were specified with an expression with side
effects (e.g., "kevp++"). This was fixed in rS110241, but by using a
local block that defined an internal variable (named "kevp") to get
the pointer value once. This worked, but could cause issues if an
existing variable named "kevp" is in scope. To avoid that issue,
jilles@ pointed out that "C99 compound literals and designated
initializers allow doing this cleanly using a macro". This change
incorporates that suggestion, essentially verbatim from jilles@
comment on PR43905, except retaining the old definition for pre-C99 or
non-STDC (e.g., C++) compilers.

PR: 43905
Submitted by: Jilles Tjoelker (jilles@)
Reported by: Lamont Granquist <lamont@scriptkiddie.org>
Reviewed by: jmg (no comments), jilles
MFC after: 1 week
Sponsored by: Dell EMC
Differential Revision: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=43905

5 years agoFix quoting in sending the NOMATCH event to devmatch
imp [Thu, 28 Jun 2018 15:00:18 +0000 (15:00 +0000)]
Fix quoting in sending the NOMATCH event to devmatch

The NOMATCH event was previously quoted to protect it from shell
expansion. However, that quoting now interferes with the quoting devd
is doing. Quote to protect just the ?.

5 years agoSimplify using bsd.endian.mk and have it provide CAP_MKDB_ENDIAN, since it is
brd [Thu, 28 Jun 2018 13:48:59 +0000 (13:48 +0000)]
Simplify using bsd.endian.mk and have it provide CAP_MKDB_ENDIAN, since it is
the most common usage.

Approved by: bapt (mentor)

5 years agoAdd NULL pointer check.
ae [Thu, 28 Jun 2018 11:39:27 +0000 (11:39 +0000)]
Add NULL pointer check.

encap_lookup_t method can be invoked by IP encap subsytem even if none
of gif/gre/me interfaces are exist. Hash tables are allocated on demand,
when first interface is created. So, make NULL pointer check before
doing access to hash table.

PR: 229378

5 years agoRemove extra "ipfw" from example.
ae [Thu, 28 Jun 2018 09:42:30 +0000 (09:42 +0000)]
Remove extra "ipfw" from example.

MFC after: 1 week

5 years agoifconfig(8): Attempt to render non-printable sequences w/ UTF-8 Environment
kevans [Thu, 28 Jun 2018 03:37:15 +0000 (03:37 +0000)]
ifconfig(8): Attempt to render non-printable sequences w/ UTF-8 Environment

Currently ifconfig(8) only prints the hex representation of ssid names
with non-ASCII characters. Many modern terminals are able to properly render
non-ASCII characters. This change checks if the terminal charmap is UTF-8,
and if so, will render the characters, rather than the hex value.

This behavior is circumvented by running ifconfig(8) in a non-UTF8 locale;
e.g. C or POSIX.

It was pointed out by kp@ during the review that APs have the option to
broadcast whether their SSIDs may be interpreted as UTF-8. Ideally, we would
honor this and only attempt this behavior if it's so-broadcasted by the AP.

However, a sample survey showed that hostapd will advertise this if
indicated in config but it doesn't seem to be so common in the AP market, so
this would be effectively useless as we'll rarely know if the SSID should be
renderable as UTF-8.

Despite this, it was decided to be OK with this anyways- there's a
straightforward path to doing it the right way based on advertisement by AP
if we need to go that route, and one can revert to old behavior easily
enough at runtime if we get it wrong.

Submitted by: Farhan Khan <khanzf@gmail.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D15922

5 years agoWe're not, yet, at C++11 capable on all our plaforms.
imp [Thu, 28 Jun 2018 01:45:53 +0000 (01:45 +0000)]
We're not, yet, at C++11 capable on all our plaforms.

Use a possibly slower, but C++98 compatibe way to iterate through the
string.

Noticed by: g++ 4.2.1 and Mark Millard

5 years agoSafely quote all variable expansions.
imp [Wed, 27 Jun 2018 23:44:37 +0000 (23:44 +0000)]
Safely quote all variable expansions.

When expanding a variable set by a message from the kernel, safely
quote all arguments expanded when creating a command line for the
shell.

Reviewd by: Shawn Webb, Oliver Pinter, brd@
Sponsored by: Netflix

5 years agoFix typo in top-level Makefile
dteske [Wed, 27 Jun 2018 22:15:50 +0000 (22:15 +0000)]
Fix typo in top-level Makefile

Submitted by: Ben Widawsky <ben.widawsky@intel.com>
MFC after: 3 days
X-MFC-to: stable/11 stable/10
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/P186

5 years agoCheck the inp_flags under inp lock. Looks like the race was hidden
glebius [Wed, 27 Jun 2018 22:01:59 +0000 (22:01 +0000)]
Check the inp_flags under inp lock. Looks like the race was hidden
before, the conversion of tcbinfo to CK_LIST have uncovered it.

5 years agoCorrect r335242. Use unsigned cast instead of abs(). Using abs() gives
glebius [Wed, 27 Jun 2018 22:00:50 +0000 (22:00 +0000)]
Correct r335242. Use unsigned cast instead of abs(). Using abs() gives
incorrect result when ticks has already wrapped, and are about to reach
the cr_ticks value (cr_ticks - ticks < hz).

Submitted by: bde

5 years agoLLVM_TARGET_ALL: Default LLVM_TARGET_ARM on for aarch64.
bdrewery [Wed, 27 Jun 2018 21:36:57 +0000 (21:36 +0000)]
LLVM_TARGET_ALL: Default LLVM_TARGET_ARM on for aarch64.

This is needed for -m32 support which is used in the kernel cloudabi32 module.

Tweak the style to make it easier to understand.

MFC after: 2 weeks
X-MFC-with: r335706
Reported by: Mark Millard
Sponsored by: Dell EMC

5 years agoStop building intermediate .o files.
bdrewery [Wed, 27 Jun 2018 21:36:49 +0000 (21:36 +0000)]
Stop building intermediate .o files.

These are not used to link the final tool anymore.  At some point in the past
the suffix rules changed to not link these in.  The original reason for this in
r19176 is unclear but seems to be related to mkdep.  The .depend handling is
still broken here as it is for all build tool patterns like this.

Sponsored by: Dell EMC

5 years agoDon't use CCACHE for linking.
bdrewery [Wed, 27 Jun 2018 19:29:15 +0000 (19:29 +0000)]
Don't use CCACHE for linking.

MFC after: 2 weeks
Sponsored by: Dell EMC

5 years agoFix description for the "autoconf" ifconfig(8) flag; it's an address
trasz [Wed, 27 Jun 2018 19:28:37 +0000 (19:28 +0000)]
Fix description for the "autoconf" ifconfig(8) flag; it's an address
property, not something you set for an interface.

MFC after: 2 weeks

5 years agoChase the pwd_mkdb endian changes.
brd [Wed, 27 Jun 2018 19:10:32 +0000 (19:10 +0000)]
Chase the pwd_mkdb endian changes.

Approved by: bapt (mentor)

5 years agoFollow-up r335706: Fix LLVM_TARGET_ALL handling to use TARGET_ARCH.
bdrewery [Wed, 27 Jun 2018 18:43:34 +0000 (18:43 +0000)]
Follow-up r335706: Fix LLVM_TARGET_ALL handling to use TARGET_ARCH.

Pointyhat to: bdrewery
MFC after: 2 weeks
X-MFC-with: r335706
Reported by: Mark Millard
Sponsored by: Dell EMC

5 years agoFix GCC 4.2.1 to honor --sysroot for includes.
jhb [Wed, 27 Jun 2018 18:14:33 +0000 (18:14 +0000)]
Fix GCC 4.2.1 to honor --sysroot for includes.

- Change the C++ directory entries to honor --sysroot if it is set.
- Don't define CROSS_INCLUDE_DIR for the cross compiler.  Instead, set
  TARGET_SYSTEM_ROOT to point to WORLDTMP and always define
  STANDARD_INCLUDE_DIR.
- Change STANDARD_INCLUDE_DIR and the C++ include directories to just
  start with "/usr" always.  The compiler will prepend the sysroot when
  doing cross-builds.  GCC_INCLUDE_DIR (which contains headers that ship
  with the compiler such as intrinsincs rather than OS-supplied headers)
  remains hardcoded to look in TOOLS_PREFIX.

Reviewed by: bdrewery (older version)
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D15127

5 years agoDon't hardcode the TOOLS_PREFIX for the startfiles directories.
jhb [Wed, 27 Jun 2018 18:11:47 +0000 (18:11 +0000)]
Don't hardcode the TOOLS_PREFIX for the startfiles directories.

GCC 4.2 prefixes these directories with --sysroot meaning that during
buildworld they have a double sysroot.

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

5 years agoAdd FreeBSD 11.2.
gjb [Wed, 27 Jun 2018 17:40:29 +0000 (17:40 +0000)]
Add FreeBSD 11.2.

Sponsored by: The FreeBSD Foundation

5 years agoRegenerate
bdrewery [Wed, 27 Jun 2018 17:18:12 +0000 (17:18 +0000)]
Regenerate

5 years agoPush users towards LLVM_TARGET_ALL.
bdrewery [Wed, 27 Jun 2018 17:13:36 +0000 (17:13 +0000)]
Push users towards LLVM_TARGET_ALL.

MFC after: 1 week

5 years agotinderbox: Only build clang/lld once if needed.
bdrewery [Wed, 27 Jun 2018 16:58:10 +0000 (16:58 +0000)]
tinderbox: Only build clang/lld once if needed.

Need to handle LLD_BOOTSTRAP separately (for archs like i386).
This would be much better off with an off-by-default option like
SHARED_TOOLCHAIN that universe force-enabled.  Then a normal buildworld
would store the toolchain there if enabled and otherwise in WORLDTMP
with only the 1 arch selected.

MFC after: 3 weeks
Sponsored by: Dell EMC

5 years agoCCACHE_BUILD: Don't try using ccache for compile-linking .c files.
bdrewery [Wed, 27 Jun 2018 16:58:07 +0000 (16:58 +0000)]
CCACHE_BUILD: Don't try using ccache for compile-linking .c files.

Without -c ccache just executes the real compiler.

MFC after: 2 weeks
Sponsored by: Dell EMC

5 years agoCCACHE_BUILD: Avoid ccache when looking up compiler metadata.
bdrewery [Wed, 27 Jun 2018 16:58:03 +0000 (16:58 +0000)]
CCACHE_BUILD: Avoid ccache when looking up compiler metadata.

MFC after: 2 weeks
Sponsored by: Dell EMC

5 years agotinderbox: Give details about kernel builds.
bdrewery [Wed, 27 Jun 2018 16:57:59 +0000 (16:57 +0000)]
tinderbox: Give details about kernel builds.

This is a bit noisy now but it was silent before leading to
wondering if it was doing anything.

MFC after: 1 week
Suggested by: rpokala
Sponsored by: Dell EMC

5 years agoClang: Only build needed target for bootstrap compiler.
bdrewery [Wed, 27 Jun 2018 16:57:56 +0000 (16:57 +0000)]
Clang: Only build needed target for bootstrap compiler.

This will disable the new LLVM_TARGET_ALL option which will only
enable the required target.

This only impacts the bootstrap compiler in WORLDTMP, not the target compiler
that will be installed.

MFC after: 2 weeks
Reviewed by: sbruno, dim (earlier version)
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16021

5 years agoAdd LLVM_TARGET_ALL option.
bdrewery [Wed, 27 Jun 2018 16:57:51 +0000 (16:57 +0000)]
Add LLVM_TARGET_ALL option.

LLVM_TARGET_* will auto be set based on LLVM_TARGET_ALL and MK_CLANG.

If LLVM_TARGET_ALL is disabled, during a cross-build, then SYSTEM_COMPILER
and SYSTEM_LINKER are auto disabled.

This option should be used by users rather than the per-arch LLVM_TARGET
options as it is simpler to maintain for them should the supported
target list change.

MFC after: 2 weeks
Reviewed by: sbruno, dim
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16020

5 years agoUse dependent options to auto enable _SUPPORT and CLANG_FULL options.
bdrewery [Wed, 27 Jun 2018 16:57:47 +0000 (16:57 +0000)]
Use dependent options to auto enable _SUPPORT and CLANG_FULL options.

MFC after: 1 week
Reviewed by: sbruno, dim
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16018

5 years agoRework check for libclang_rt to see if the needed library exists.
bdrewery [Wed, 27 Jun 2018 16:56:46 +0000 (16:56 +0000)]
Rework check for libclang_rt to see if the needed library exists.

Currently libclang_rt is not provided for cross-building and as such
is not connected to cross-tools.  For building clang once in universe
it is likely that libclang_rt won't exist for the universe toolchain
but even if it did it would not support anything but the native arch.
So explicitly check for support before enabling h_raw.

MFC after: 1 week
Reviewed by: dim
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D16012

5 years agoaudit(4): fix Coverity issues
asomers [Wed, 27 Jun 2018 15:28:09 +0000 (15:28 +0000)]
audit(4): fix Coverity issues

Fix several incorrect buffer size arguments and a file descriptor leak.

Submitted by: aniketp
Reported by: Coverity
CID: 1393489 1393501 1393509 1393510 1393514 1393515 1393516
CID: 1393517 1393518 1393519
MFC after: 2 weeks
X-MFC-With: 335284
X-MFC-With: 335318
X-MFC-With: 335320
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16000

5 years agoSplit kern_break from sys_break and use it in linuxulator
emaste [Wed, 27 Jun 2018 14:45:13 +0000 (14:45 +0000)]
Split kern_break from sys_break and use it in linuxulator

Previously the linuxulator's linux_brk invoked the FreeBSD sys_break
syscall implementation directly.  Instead, move the bulk of the existing
implementation to kern_break, and call that from both sys_break and
linux_brk.

This also addresses a minor bug in linux_brk in that we now return the
actual (rounded up) break address, rather than the requested value.

Reviewed by: brooks (earlier version)
Sponsored by: Turing Robotic Industries
Differential Revision: https://reviews.freebsd.org/D16019

5 years agocxgbe/cxgbei: Fix harmful typo in the iSCSI offload driver.
np [Wed, 27 Jun 2018 14:29:13 +0000 (14:29 +0000)]
cxgbe/cxgbei: Fix harmful typo in the iSCSI offload driver.

Reported by: gcc8 (via mmacy@)
MFC after: 3 days
Sponsored by: Chelsio Communications

5 years agoImprove the kernel's USB descriptor reading function.
hselasky [Wed, 27 Jun 2018 12:08:12 +0000 (12:08 +0000)]
Improve the kernel's USB descriptor reading function.
Some USB devices does not allow a partial descriptor readout.

Found by: bz@
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoRevert Makefile@335696 that sneaked into the commit.
delphij [Wed, 27 Jun 2018 06:50:24 +0000 (06:50 +0000)]
Revert Makefile@335696 that sneaked into the commit.

X-MFC with: 335696
MFC after: 2 weeks

5 years agoDetect exFAT filesystems and abort if found and tighten BPB sanity
delphij [Wed, 27 Jun 2018 06:49:20 +0000 (06:49 +0000)]
Detect exFAT filesystems and abort if found and tighten BPB sanity
check.

Obtained from: Android https://android-review.googlesource.com/61827
MFC after: 2 weeks

5 years agoRemove devctl_safe_quote since it's now unused.
imp [Wed, 27 Jun 2018 04:11:19 +0000 (04:11 +0000)]
Remove devctl_safe_quote since it's now unused.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D16026

5 years agopccard: recode to use devctl_safe_quote_sb instead of devctl_safe_quote.
imp [Wed, 27 Jun 2018 04:11:14 +0000 (04:11 +0000)]
pccard: recode to use devctl_safe_quote_sb instead of devctl_safe_quote.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D16026

5 years agoFix devctl generation for core files.
imp [Wed, 27 Jun 2018 04:11:09 +0000 (04:11 +0000)]
Fix devctl generation for core files.

We have a problem with vn_fullpath_global when the file exists. Work
around it by printing the full path if the core file name starts with /,
or current working directory followed by the filename if not.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D16026

5 years agoCreate new devctl_safe_quote_sb to copy a source string into a struct
imp [Wed, 27 Jun 2018 04:10:48 +0000 (04:10 +0000)]
Create new devctl_safe_quote_sb to copy a source string into a struct
sbuf to make it safe. Callers are expected to add the " " around it,
if needed.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D16026

5 years ago- Added myself to committers-src.dot
miwi [Wed, 27 Jun 2018 03:50:11 +0000 (03:50 +0000)]
- Added myself to committers-src.dot

Approved by: araujo (mentor)
Differential Revision: https://reviews.freebsd.org/D16030

5 years agotop(1): increased the maximum length of command shown by "-a"
daichi [Wed, 27 Jun 2018 02:55:30 +0000 (02:55 +0000)]
top(1): increased the maximum length of command shown by "-a"

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

5 years agocxgbe(4): Do not leak the filters in the hashfilter table on module
np [Wed, 27 Jun 2018 01:51:17 +0000 (01:51 +0000)]
cxgbe(4): Do not leak the filters in the hashfilter table on module
unload.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agopowerd: correct ifdef check for ppc
eadler [Wed, 27 Jun 2018 01:28:09 +0000 (01:28 +0000)]
powerd: correct ifdef check for ppc

Reviewed by: jhibbits