]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoDe-const to match changes in userboot.h
Warner Losh [Wed, 6 Dec 2017 05:18:52 +0000 (05:18 +0000)]
De-const to match changes in userboot.h

Sponsored by: Netflix

6 years agosponge(1): revert
Eitan Adler [Wed, 6 Dec 2017 02:47:46 +0000 (02:47 +0000)]
sponge(1): revert

I did a complete buildworld and test... with the program disconnected
from the tree. Revert the change for now.

(this keeps the change to .arclint which is still correct)

Wearing: my pointhat

6 years agoUpdate tcpdump to 4.9.2
Ed Maste [Wed, 6 Dec 2017 02:21:11 +0000 (02:21 +0000)]
Update tcpdump to 4.9.2

It contains many fixes, including bounds checking, buffer overflows (in
SLIP and bittok2str_internal), buffer over-reads, and infinite loops.

One other notable change:
  Do not use getprotobynumber() for protocol name resolution.
  Do not do any protocol name resolution if -n is specified.

Submitted by: gordon
Reviewed by: delphij, emaste, glebius
MFC after: 1 week
Relnotes: Yes
Security: CVE-2017-11108, CVE-2017-11541, CVE-2017-11542
Security: CVE-2017-11543, CVE-2017-12893, CVE-2017-12894
Security: CVE-2017-12895, CVE-2017-12896, CVE-2017-12897
Security: CVE-2017-12898, CVE-2017-12899, CVE-2017-12900
Security: CVE-2017-12901, CVE-2017-12902, CVE-2017-12985
Security: CVE-2017-12986, CVE-2017-12987, CVE-2017-12988
Security: CVE-2017-12989, CVE-2017-12990, CVE-2017-12991
Security: CVE-2017-12992, CVE-2017-12993, CVE-2017-12994
Security: CVE-2017-12995, CVE-2017-12996, CVE-2017-12997
Security: CVE-2017-12998, CVE-2017-12999, CVE-2017-13000
Security: CVE-2017-13001, CVE-2017-13002, CVE-2017-13003
Security: CVE-2017-13004, CVE-2017-13005, CVE-2017-13006
Security: CVE-2017-13007, CVE-2017-13008, CVE-2017-13009
Security: CVE-2017-13010, CVE-2017-13011, CVE-2017-13012
Security: CVE-2017-13013, CVE-2017-13014, CVE-2017-13015
Security: CVE-2017-13016, CVE-2017-13017, CVE-2017-13018
Security: CVE-2017-13019, CVE-2017-13020, CVE-2017-13021
Security: CVE-2017-13022, CVE-2017-13023, CVE-2017-13024
Security: CVE-2017-13025, CVE-2017-13026, CVE-2017-13027
Security: CVE-2017-13028, CVE-2017-13029, CVE-2017-13030
Security: CVE-2017-13031, CVE-2017-13032, CVE-2017-13033
Security: CVE-2017-13034, CVE-2017-13035, CVE-2017-13036
Security: CVE-2017-13037, CVE-2017-13038, CVE-2017-13039
Security: CVE-2017-13040, CVE-2017-13041, CVE-2017-13042
Security: CVE-2017-13043, CVE-2017-13044, CVE-2017-13045
Security: CVE-2017-13046, CVE-2017-13047, CVE-2017-13048
Security: CVE-2017-13049, CVE-2017-13050, CVE-2017-13051
Security: CVE-2017-13052, CVE-2017-13053, CVE-2017-13054
Security: CVE-2017-13055, CVE-2017-13687, CVE-2017-13688
Security: CVE-2017-13689, CVE-2017-13690, CVE-2017-13725
Differential Revision: https://reviews.freebsd.org/D12404

6 years agoAllow custom overrides of mmap attribute for VT framebuffer
Justin Hibbits [Wed, 6 Dec 2017 02:06:14 +0000 (02:06 +0000)]
Allow custom overrides of mmap attribute for VT framebuffer

Summary:
As in /dev/fb, allow the framebuffer driver to override the default memattr for
mmap(2).  This is analogous to the change in 306555.

Reviewed By: ray
Differential Revision: https://reviews.freebsd.org/D13331

6 years agoUse unsigned intptr_t type for framebuffer addresses
Justin Hibbits [Wed, 6 Dec 2017 02:05:21 +0000 (02:05 +0000)]
Use unsigned intptr_t type for framebuffer addresses

Summary:
Some architectures (powerpc Book-E) have a vm_paddr_t larger than intptr_t.
Casting from the intptr_t to vm_paddr_t causes sign extension, leading to a
potentially invalid address.

This was seen when running X on a PowerPC P1022 machine, which mapped the
backing framebuffer at 0xc1800000.  When mmap()d by X, this yielded an invalid
address of 0xffffffffc1800000, or, as the hardware would see it, 0xfc1800000.

Reviewed By: ray
Differential Revision: https://reviews.freebsd.org/D13332

6 years agoFix random() prototype to match the system.
Warner Losh [Wed, 6 Dec 2017 02:00:09 +0000 (02:00 +0000)]
Fix random() prototype to match the system.

Sponsored by: Netflix

6 years agoMake putenv and getenv match the userland definition of these
Warner Losh [Wed, 6 Dec 2017 02:00:00 +0000 (02:00 +0000)]
Make putenv and getenv match the userland definition of these
functions, tweak man page and one variable that shouldn't be const
anymore.

Sponsored by: Netflix

6 years agoFix file missed in r326607.
Gleb Smirnoff [Wed, 6 Dec 2017 00:44:49 +0000 (00:44 +0000)]
Fix file missed in r326607.

6 years agoReduce pollution via tmpfs.h.
Gleb Smirnoff [Wed, 6 Dec 2017 00:42:08 +0000 (00:42 +0000)]
Reduce pollution via tmpfs.h.

6 years agoRemove unused 4th argument to match the standard error routines.
Warner Losh [Wed, 6 Dec 2017 00:29:50 +0000 (00:29 +0000)]
Remove unused 4th argument to match the standard error routines.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13386

6 years agoAdd NVME as a known device type for devstat processing.
Warner Losh [Wed, 6 Dec 2017 00:29:43 +0000 (00:29 +0000)]
Add NVME as a known device type for devstat processing.

Also, reduce the amount of cut and pasted code a little since only two
args are different in the devstat_end_transaction calls.

Sponsored by: Netflix

6 years agomdoc(7): Update .Dd for previous commit
Jilles Tjoelker [Tue, 5 Dec 2017 23:06:15 +0000 (23:06 +0000)]
mdoc(7): Update .Dd for previous commit

6 years agoRemove stray cam_periph_async call. It's called twice this way. While
Warner Losh [Tue, 5 Dec 2017 23:02:31 +0000 (23:02 +0000)]
Remove stray cam_periph_async call. It's called twice this way. While
currently harmless for AC_UNIT_ATTENTION event (cam_periph_async does
nothing with them), it's still in error because if it were to start in
the future, it would be done twice.

Sponsored by: Netflix

6 years agomdocml: Add IEEE Std 1003.1-2008, 2016 edition
Jilles Tjoelker [Tue, 5 Dec 2017 23:00:41 +0000 (23:00 +0000)]
mdocml: Add IEEE Std 1003.1-2008, 2016 edition

Also document IEEE Std 1003.1-2008, 2013 edition in mdoc(7) (as well as the
2016 edition).

Submitted by: Yuri Pankov
Reviewed by: bjk
Differential Revision: https://reviews.freebsd.org/D13349

6 years agoSince this is contrib code, create an upstreamable version of my
Warner Losh [Tue, 5 Dec 2017 22:24:20 +0000 (22:24 +0000)]
Since this is contrib code, create an upstreamable version of my
change. Now on FreeBSD and NetBSD if _STANDALONE is defined, we
include the kernel version with alloances for the quirky differences
between the two.

Sponsored by: Netflix

6 years agoImplement "vidcontrol -h <history_size>" for vt(4)
Ed Maste [Tue, 5 Dec 2017 22:19:59 +0000 (22:19 +0000)]
Implement "vidcontrol -h <history_size>" for vt(4)

PR: 210415
Submitted by: Siva Mahadevan
Reviewed by: ray (earlier)
MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11814

6 years agodtb/allwinner: Restore a83t/BananaPi-M3 DTS after r342822
Kyle Evans [Tue, 5 Dec 2017 22:05:10 +0000 (22:05 +0000)]
dtb/allwinner: Restore a83t/BananaPi-M3 DTS after r342822

sinovoip-bpi-m3.dts was disconnected from the build in r324822. Since then,
a CCU driver has been added and several other changes have been made to
make us compatible with upstream DTS for this board.

Add links for older DTB that might be used: our u-boot port was expecting
sinovoip-bpi-m3.dtb up until ports r455629, and our u-boot will not be
switching to the upstream name (sun8i-a83t-bananapi-m3) quite yet.

Discussed with: manu

6 years agovnic: apply hardware L3 checksum only for IPv4
Ed Maste [Tue, 5 Dec 2017 22:02:46 +0000 (22:02 +0000)]
vnic: apply hardware L3 checksum only for IPv4

Previously we set the csum_l3 flag for IPv4 and IPv6, but only IPv4
should have header checksumming applied.

Prompted by Linux commit fa6d7cb5d76cf0467c61420fc9238045aedfd379.

Reviewed by: bz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13366

6 years agoMakefile.inc1: map mips MACHINE_/TARGET_ARCH to triples
Ed Maste [Tue, 5 Dec 2017 21:42:09 +0000 (21:42 +0000)]
Makefile.inc1: map mips MACHINE_/TARGET_ARCH to triples

This helps Clang MIPS builds.

Reviewed by: bdrewery, jhb (earlier version)
Differential Revision: https://reviews.freebsd.org/D12171

6 years agoa10_gpio: Don't do read/set dance if pin is already configured for output
Kyle Evans [Tue, 5 Dec 2017 21:40:52 +0000 (21:40 +0000)]
a10_gpio: Don't do read/set dance if pin is already configured for output

This fixes some regulator issues with a83t/BananaPi-M3; the pin value was
getting clobbered as we reconfigured the pin when initializing the
regulator.

Discussed with: ian

6 years agoNow that we offer a semi-sane standards-ish set of #include files in
Warner Losh [Tue, 5 Dec 2017 21:38:24 +0000 (21:38 +0000)]
Now that we offer a semi-sane standards-ish set of #include files in
the stand environment that's safe to use (and insulated from whatever
build env you might normally have), stop hacking the bzlib and zlib
sources with sed. There's no longer any need.

Sponsored by: Netflix

6 years agoStop building with the standard system headers.
Warner Losh [Tue, 5 Dec 2017 21:38:19 +0000 (21:38 +0000)]
Stop building with the standard system headers.

Building with the standard system headers isn't a perfect match to the
stand environment. Instead, copy over the files we know are safe to
use and constrain what else is used. We use -nostdinc to achieve this.

This also fixes issues with building 32-bit libraries on amd64
sometimes pulling in the wrong cpufunc.h giving an error now that we
stop on errors. It will also enable an easier transition to lua boot.

Sponsored by: Netflix

6 years agoDon't inherit CFLAGS. This a specialized test program, and can be
Warner Losh [Tue, 5 Dec 2017 21:38:14 +0000 (21:38 +0000)]
Don't inherit CFLAGS. This a specialized test program, and can be
built with mostly default flags. Do so in anticipation of the rest of
stand not building with system headers.

Sponsored by: Netflix

6 years agoThis isn't NetBSD specific code. Include these for any kernel /
Warner Losh [Tue, 5 Dec 2017 21:38:10 +0000 (21:38 +0000)]
This isn't NetBSD specific code. Include these for any kernel /
standalone use. Tweak for FreeBSD's quirky limits.h stuff.

Sponsored by: Netflix

6 years agoPrefer stdint.h to inttypes.h since the added prototypes form the
Warner Losh [Tue, 5 Dec 2017 21:38:04 +0000 (21:38 +0000)]
Prefer stdint.h to inttypes.h since the added prototypes form the
latter aren't used. Prefer sys/link_elf.h to link.h so we're only
dependent on the kernel tree. The default installation of link.h just
includes this file, and any benefit from that is outweighed by the
hassle it causes. This reduces the footprint of files needed from the
system includes (or sysroot in buildworld).

Sponsored by: Netflix

6 years agoMake sure we include the right path for skein.h, as well only include
Warner Losh [Tue, 5 Dec 2017 21:37:59 +0000 (21:37 +0000)]
Make sure we include the right path for skein.h, as well only include
the ZFS flags for zfs_modules.c. This keeps us from pulling from the
system or sysroot during buildworld.

6 years agoNeed to include skein in the include path so we don't get this from
Warner Losh [Tue, 5 Dec 2017 21:37:55 +0000 (21:37 +0000)]
Need to include skein in the include path so we don't get this from
the "system" headers (though in buildworld, it's from the recently
built sysroot).

Sponsored by: Netflix

6 years agoUse the kernel relative paths, rather than the userland relative paths
Warner Losh [Tue, 5 Dec 2017 21:37:50 +0000 (21:37 +0000)]
Use the kernel relative paths, rather than the userland relative paths
for the iso9660 header files.

Sponsored by: Netflix

6 years agoNo need to include the userland md5.h, the kernel one is just fine.
Warner Losh [Tue, 5 Dec 2017 21:37:45 +0000 (21:37 +0000)]
No need to include the userland md5.h, the kernel one is just fine.

Sponsored by: Netflix

6 years agoInclude ficl.h before anything else and avoid including anything at
Warner Losh [Tue, 5 Dec 2017 21:37:41 +0000 (21:37 +0000)]
Include ficl.h before anything else and avoid including anything at
all if we're not building float.

Sponsored by: Netflix

6 years agoWhen building standalone, include stand.h rather than the kernel
Warner Losh [Tue, 5 Dec 2017 21:37:32 +0000 (21:37 +0000)]
When building standalone, include stand.h rather than the kernel
includes or the userland includes.

Sponsored by: Netflix

6 years agonative-xtools: Ensure GCC files are cleaned up.
Bryan Drewery [Tue, 5 Dec 2017 21:36:08 +0000 (21:36 +0000)]
native-xtools: Ensure GCC files are cleaned up.

Because we force enable MK_GCC when building we need to also force
enable it for the cleaning phase.  Otherwise the NXB_TARGET files
are found in the next build's kernel-toolchain phase and cause
an error.

Reported by: sbruno
X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC

6 years agoDeal with bmake-20170301 no longer resolving -C like it used to.
Bryan Drewery [Tue, 5 Dec 2017 21:30:22 +0000 (21:30 +0000)]
Deal with bmake-20170301 no longer resolving -C like it used to.

Several checks assume .CURDIR is resolved, such as for determining RELDIR from
SRCTOP/.CURDIR.  If -C is used then the path is no longer resolved like it was
before which is problematic for symlinked source trees.  A similar change was
also made to ports post bmake-20170301.

This fixes 'make -C <symlinked path> buildworld' using the wrong OBJDIR.

Reported by: rstone
Sponsored by: Dell EMC

6 years agoHandle writable-but-not-a-directory cases for writable OBJDIR check.
Bryan Drewery [Tue, 5 Dec 2017 21:30:17 +0000 (21:30 +0000)]
Handle writable-but-not-a-directory cases for writable OBJDIR check.

Sponsored by: Dell EMC

6 years agoAUTO_OBJ: For all top-level targets enforce using an OBJDIR.
Bryan Drewery [Tue, 5 Dec 2017 21:29:47 +0000 (21:29 +0000)]
AUTO_OBJ: For all top-level targets enforce using an OBJDIR.

This will cause an error if the wanted OBJDIR is not writable.  Previously it
would cause the files to generate to the source tree.  This was too obscure and
things like buildworld really expect a proper OBJDIR layout.

Sponsored by: Dell EMC

6 years agoAllwinner H5: Enhance support
Emmanuel Vadot [Tue, 5 Dec 2017 21:21:23 +0000 (21:21 +0000)]
Allwinner H5: Enhance support

Add proper gpio and clock support

6 years agoiflib: Support to padding Ethernet frames to a min size
Stephen Hurd [Tue, 5 Dec 2017 21:00:31 +0000 (21:00 +0000)]
iflib: Support to padding Ethernet frames to a min size

Some bnxt devices do not correctly send frames smaller than
52 bytes (without CRC), so add a quirk that will pad frames to an
arbitrary size before passing off to the encap routine.

Reported by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D13269

6 years agoAvoid calling CURVNET_[SET|RESTORE] for each packet
Stephen Hurd [Tue, 5 Dec 2017 20:43:24 +0000 (20:43 +0000)]
Avoid calling CURVNET_[SET|RESTORE] for each packet

The LRO possible test was calling CURVNET_SET once for IPv4 or IPv6 for
each packet in a chain. Only call it once per chain instead.

Submitted by: Matthew Macy <mmacy@mattmacy.io>
Reviewed by: cem, ae
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D13368

6 years agouse @@@ instead of @@ in __sym_default
Ed Maste [Tue, 5 Dec 2017 20:19:13 +0000 (20:19 +0000)]
use @@@ instead of @@ in __sym_default

Using
    .symver foo,foo@@VER
causes foo and foo@@VER to be output to the .o file. This requires foo
to be weak since the linker handles foo@@VER as foo.

Using
    .symver foo,foo@@@VER
causes just foo@@ver to be output and avoid the need for making foo
weak. It also reduces the constraint on how exactly a linker has to
handle foo and foo@@VER being present.

Submitted by: Rafael Espíndola
Reviewed by: dim, kib
Differential Revision: https://reviews.freebsd.org/D11653

6 years agoFix build after r326554; reconnect sponge to build again.
Cy Schubert [Tue, 5 Dec 2017 20:06:53 +0000 (20:06 +0000)]
Fix build after r326554; reconnect sponge to build again.

6 years agoGenerate fully RFC3164 compliant messages, with timestamp and hostname.
Gleb Smirnoff [Tue, 5 Dec 2017 19:55:53 +0000 (19:55 +0000)]
Generate fully RFC3164 compliant messages, with timestamp and hostname.
Allow to set hostname to any string with -H.

MFC after: 2 months

6 years agoWhen parsing remote messages, require them to have standard timestamp
Gleb Smirnoff [Tue, 5 Dec 2017 19:54:55 +0000 (19:54 +0000)]
When parsing remote messages, require them to have standard timestamp
field, and support properly parse out the hostname as described by RFC3164,
which wasn't done before.  However, don't discard message if it doesn't
have hostname, for compatibility.

Enable logging of the message supplied hostname instead of real hostname
with -H switch.

PR: 200933
Reported by: Konstantin Pavlov <thresh nginx.com>
MFC after: 2 months

6 years agoioat(4): Add Skylake Xeon PCI-ID
Conrad Meyer [Tue, 5 Dec 2017 18:48:58 +0000 (18:48 +0000)]
ioat(4): Add Skylake Xeon PCI-ID

SKX IOAT is just another 3.2 version of the CBDMA engine.

Submitted by: Deepak Veliath <deepak.veliath AT isilon.com>
Sponsored by: Dell EMC Isilon

6 years agoifconfig(8): Display extended compliance code string for SFP transceivers
Eric Joyner [Tue, 5 Dec 2017 18:42:07 +0000 (18:42 +0000)]
ifconfig(8): Display extended compliance code string for SFP transceivers

- Updates tables in affected files with new entries from newer spec
revisions of SFF-8472, SFF-8024, and SFF-8636

- Change ifconfig to read and display the extended compliance code for
SFP media if the extended compliance code is not 0. This was being displayed
for QSFP transceivers only, but SFP28 media uses this to report 25G
capability.

Reviewed by: melifaro, sbruno
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D13286

6 years agoFor now, disconnect usr.bin/sponge from the build, to unbreak world
Dimitry Andric [Tue, 5 Dec 2017 18:26:34 +0000 (18:26 +0000)]
For now, disconnect usr.bin/sponge from the build, to unbreak world
after r326557.

Noticed by: many
Pointy hat to: eadler

6 years agoFix cyclic dependency after r326552.
Bryan Drewery [Tue, 5 Dec 2017 17:23:33 +0000 (17:23 +0000)]
Fix cyclic dependency after r326552.

The OBJS_DEPEND_GUESS mechanism was making vmx_genassym.o depend
on all headers along with vmx_assym.h, though vmx_assym.h depends
on having vmx_genassym.o present to generate.  Moving the headers
to DPSRCS is enough to resolve the issue as they will no longer
be implicit dependencies for all objects.  Because of this we
need explicit OBJS_DEPEND_GUESS entries to ensure the headers
are generated when needed for the *_support.o files that need
them.

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

6 years agoddb: fix validation of cpu id in 'set db_cpu=x'
Andriy Gapon [Tue, 5 Dec 2017 14:22:08 +0000 (14:22 +0000)]
ddb: fix validation of cpu id in 'set db_cpu=x'

MFC after: 1 week

6 years agoFix cut & paste error from r326558.
Cy Schubert [Tue, 5 Dec 2017 13:41:21 +0000 (13:41 +0000)]
Fix cut & paste error from r326558.

Reported by: ed
MFC after: 1 week
X-MFC with: r326558
Pointy hat to: cy

6 years agoMake EC2 instances use Amazon's NTP service for time synchronization.
Colin Percival [Tue, 5 Dec 2017 09:22:14 +0000 (09:22 +0000)]
Make EC2 instances use Amazon's NTP service for time synchronization.

Since Amazon provides NTP servers within their network, this should
be far superior to using the default NTP pools; and since the service
is provided by Amazon there's very little risk in enabling it by
default.  (If someone is able to compromise Amazon's NTP servers and
exploit them to attack EC2 instances, they would almost certainly be
able to compromise EC2 instances even without ntpd running...)

MFC after: 1 week
Relnotes: EC2 instances now keep their clocks synchronized using
the Amazon Time Sync Service (aka. NTP).

6 years agoResurrect r321659: Turn off ChallengeResponseAuthentication for EC2 AMIs.
Colin Percival [Tue, 5 Dec 2017 09:08:48 +0000 (09:08 +0000)]
Resurrect r321659: Turn off ChallengeResponseAuthentication for EC2 AMIs.

EC2 instances are normally launched with an SSH public key specified,
which is then used for logging in (by default, as 'ec2-user').  Having
ChallengeResponseAuthentication enabled (as FreeBSD's default sshd_config
does) has no functional effect in a new EC2 instance, since you can't log
in using a password until a password has been set -- but having this
enabled results in alerts from automated scanning tools which can detect
that sshd advertises support for keyboard-interactive logins (since they
can't detect that accounts have no password set).

EC2 users who want to use passwords to log in to their instances will need
to set 'ChallengeResponseAuthentication yes' in FreeBSD 12.0 and later.

Discussed with: gjb, gtetlow, emaste, des
Requested by: Amazon
X-MFC: No
Relnotes: ChallengeResponseAuthentication is turned off by default in
Amazon EC2 AMIs.

6 years agoCorrectly prefix the infiniband include directory for buildworld. This fixes
Hans Petter Selasky [Tue, 5 Dec 2017 08:25:17 +0000 (08:25 +0000)]
Correctly prefix the infiniband include directory for buildworld. This fixes
the OFED buildworld target, WITH_OFED=YES, when the include files are not
already installed locally, but only in the temporary object directory.

Found by: kib
Sponsored by: Mellanox Technologies

6 years agoUse strlcpy().
Xin LI [Tue, 5 Dec 2017 07:21:47 +0000 (07:21 +0000)]
Use strlcpy().

MFC after: 2 weeks

6 years agoUse strlcpy().
Xin LI [Tue, 5 Dec 2017 07:11:56 +0000 (07:11 +0000)]
Use strlcpy().

MFC after: 2 weeks

6 years agoCreate links for xzdiff.
Xin LI [Tue, 5 Dec 2017 07:01:10 +0000 (07:01 +0000)]
Create links for xzdiff.

MFC after: 2 weeks

6 years agofdformat is a sysadmin command and thus its man page should be in
Cy Schubert [Tue, 5 Dec 2017 05:02:46 +0000 (05:02 +0000)]
fdformat is a sysadmin command and thus its man page should be in
volume 8 instead of volume 1.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D13370

6 years agosponge(1): fix my tests
Eitan Adler [Tue, 5 Dec 2017 04:43:39 +0000 (04:43 +0000)]
sponge(1): fix my tests

Reviewed by: kevans

6 years agodc(1): fix input of non-decimal fractional numbers
Alan Somers [Tue, 5 Dec 2017 04:22:35 +0000 (04:22 +0000)]
dc(1): fix input of non-decimal fractional numbers

Inputting fractional non-decimal numbers has never worked correctly in our
OpenBSD-derived dc(1). It truncates the input to a number of decimal places
equal to the number of hexadecimal (or whatever base) places given on the
input. That's unacceptable, because many numbers require more precision to
represent in base 10 than in their original bases.

Fix this bug by using as many decimal places as needed to represent the
input, up to the maximum of the global scale factor.

This has one mildly surprising side effect: the scale of a number entered in
non-decimal mode will no longer necessarily equal the number of hexadecimal
(or whatever base) places given on the input. I think that's an acceptable
behavior change, given that inputting fractional non-decimal numbers never
worked in the first place, and the man page doesn't specify whether trailing
zeros on the input should affect a number's scale.

PR: 206230
Reported by: nibbana@gmx.us
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D13336

6 years agosponge(1) Minor commit for commit log
Eitan Adler [Tue, 5 Dec 2017 03:57:51 +0000 (03:57 +0000)]
sponge(1) Minor commit for commit log

Differential Revision: https://reviews.freebsd.org/D12900
RelNotes: yes

6 years agosponge(1): initial commit
Eitan Adler [Tue, 5 Dec 2017 03:55:10 +0000 (03:55 +0000)]
sponge(1): initial commit

sponge(1) is a utility that reads input until
complete, then opens the output file, then
writes to it. This makes it useful in pipelines
that read and write to the same file.

Reviewed by: wblock, jilles, imp, cem, danfe (all: various iterations)
Inspired by: https://joeyh.name/code/moreutils/

6 years agonative-xtools: Fix build without META_MODE for GCC archs.
Bryan Drewery [Tue, 5 Dec 2017 02:23:36 +0000 (02:23 +0000)]
native-xtools: Fix build without META_MODE for GCC archs.

The initial kernel-toolchain is built with TARGET=MACHINE but
we want GCC to have files generated for TARGET=NXB_TARGET
instead later on.  Just clean the files between building of
the toolchain and nxb binaries which will let it rebuild
when needed.

Reported by: sbruno
X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC

6 years agoFix DPSRCS not getting .depend.* files.
Bryan Drewery [Tue, 5 Dec 2017 02:23:33 +0000 (02:23 +0000)]
Fix DPSRCS not getting .depend.* files.

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

6 years agoAllow Makefiles to append to DEPENDSRCS.
Bryan Drewery [Tue, 5 Dec 2017 02:23:30 +0000 (02:23 +0000)]
Allow Makefiles to append to DEPENDSRCS.

Sponsored by: Dell EMC

6 years agoDEPENDSRCS not used here.
Bryan Drewery [Tue, 5 Dec 2017 02:23:27 +0000 (02:23 +0000)]
DEPENDSRCS not used here.

Sponsored by: Dell EMC

6 years agoRename DEPENDFILES_OBJS to DEPENDFILES.
Bryan Drewery [Tue, 5 Dec 2017 02:23:23 +0000 (02:23 +0000)]
Rename DEPENDFILES_OBJS to DEPENDFILES.

This is to be consistent with bsd.dep.mk using DEPENDFILES after
r325677.

Sponsored by: Dell EMC

6 years agolld: make -v behave similarly to GNU ld.bfd
Ed Maste [Tue, 5 Dec 2017 01:47:41 +0000 (01:47 +0000)]
lld: make -v behave similarly to GNU ld.bfd

Previously, lld exited with an error status if the only option given to
the command was -v. GNU linkers gracefully exit in that case. This patch
makes lld behave like GNU.

Note that even with this patch, lld's -v and --version options behave
slightly differently than GNU linkers' counterparts. For example,
if you run ld.bfd -v -v, the version string is printed out twice.
But that is an edge case that I don't think we need to take care of.

Fixes https://bugs.llvm.org/show_bug.cgi?id=31582

Obtained from: LLVM r319717
MFC after: 1 week

6 years agoAvoid the overhead of acquiring a lock in nfsrv_checkgetattr() when
Rick Macklem [Mon, 4 Dec 2017 21:50:27 +0000 (21:50 +0000)]
Avoid the overhead of acquiring a lock in nfsrv_checkgetattr() when
there are no write delegations issued.

manu@ reported on the freebsd-current@ mailing list that there was
a significant performance hit in nfsrv_checkgetattr() caused by
the acquisition/release of a state lock, even when there were no
write delegations issued.
This patch add a count of outstanding issued write delegations to the
NFSv4 server. This count allows nfsrv_checkgetattr() to return without
acquiring any lock when the count is 0, avoiding the performance hit
for the case where no write delegations are issued.

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

6 years agoAllwinner: Add H5 compatible to aw_ccu
Emmanuel Vadot [Mon, 4 Dec 2017 20:45:15 +0000 (20:45 +0000)]
Allwinner: Add H5 compatible to aw_ccu

Recent DTS (from Linux 4.14) specify a compatible "allwinner,sun50i-h5-ccu"
for H5 SoC. Since we get the DTB from u-boot this wasn't noticed.
Add the compatible so later version of u-boot will not fail for us.

6 years agoamd-vi: set iommu msi configuration using pci_enable_msi method
Andriy Gapon [Mon, 4 Dec 2017 17:10:52 +0000 (17:10 +0000)]
amd-vi: set iommu msi configuration using pci_enable_msi method

This is better than directly changing PCI configuration space of the
device because it makes the PCI bus aware of the configuration.
Also, the change allows to drop a bunch of code that duplicated
pci_enable_msi() functionality.

I wonder if it's possible to further simplify the code by using
pci_alloc_msi().

6 years agovmm/amd: add ivhd device with a higher order
Andriy Gapon [Mon, 4 Dec 2017 17:08:03 +0000 (17:08 +0000)]
vmm/amd: add ivhd device with a higher order

ivhd should attach after the root PCI bus and, thus, after the ACPI
Host-PCI bridge off which the bus hangs.  This is because ivhd changes
PCI configuration of a PCI IOMMU device that is located on the root bus.
If the bus attaches after ivhd it clears the MSI portion of the
configuration.  As a result IOMMU event interrupts would never be
delivered.

For regular ACPI devices the order is calculated as
    ACPI_DEV_BASE_ORDER + level * 10
where level is a depth of the device in the ACPI namespace.
I expect the depth of the Host-PCI bridge to be two or three,
so ACPI_DEV_BASE_ORDER + 10 * 10 should be a sufficiently safe order
for ivhd.

This should fix the setup of the AMD-Vi event interrupt when vmm is
preloaded (as opposed to kldload-ed).

6 years agoamd-vi: clear event interrupt and overflow bits upon handling the interrupt
Andriy Gapon [Mon, 4 Dec 2017 17:02:53 +0000 (17:02 +0000)]
amd-vi: clear event interrupt and overflow bits upon handling the interrupt

This ensures that we can receive further event interrupts.
See the description of the bits in the specification for
MMIO Offset 2020h IOMMU Status Register.
The bits are defined as set-by-hardware write-1-to-clear, same as all
the bits in the status register.

Discussed with: anish

6 years agoJust use the last line of the output from getting .OBJDIR. The
Warner Losh [Mon, 4 Dec 2017 16:38:20 +0000 (16:38 +0000)]
Just use the last line of the output from getting .OBJDIR. The
buildenv target prints other stuff too that needs to be ignored.

Sponsored by: Netflix

6 years agodts: arm: Remove imx6 related dts
Emmanuel Vadot [Mon, 4 Dec 2017 13:28:56 +0000 (13:28 +0000)]
dts: arm: Remove imx6 related dts

Everything should work with dts from sys/gnu/dts

Discussed with: ian

6 years agoOnly skip looking for manpages if both man directory and cat directory
Baptiste Daroussin [Mon, 4 Dec 2017 12:51:05 +0000 (12:51 +0000)]
Only skip looking for manpages if both man directory and cat directory
are not existing.

This allows man(1) to read catpages when no man directories are available at all

PR: 223559
Reported by: wosch
MFC after: 3 days

6 years agoIn case man(1) found a catpage to display skip looking ".so" which is manpage
Baptiste Daroussin [Mon, 4 Dec 2017 12:33:46 +0000 (12:33 +0000)]
In case man(1) found a catpage to display skip looking ".so" which is manpage
only.

In case we are trying to read a catpage, the manpage variable is not defined.
It results in the "cattool" having no arguments.

In case the catpage is compressed, the cattool used is "zcat" which dies if the
standard input is a terminal, meaning the function calling it is exiting as if
there were no ".so"
In case the catpage is uncompressed, the cattool used is "zcat -f" which waits
reading standard input, making the man(1) command hang.

PR: 223560
Reported by: wosch
MFC after: 3 days

6 years agoUse the module pointer to find the address we need to map to in the early
Andrew Turner [Mon, 4 Dec 2017 11:25:34 +0000 (11:25 +0000)]
Use the module pointer to find the address we need to map to in the early
arm64 boot sequence. This will be a virtual address in the kernel space
after the kernel and any modules loaded by loader so we can use this to
find the size of the kernel + modules. We can then add on a level 2 page for
the module data and round up the size to be aligned to a level 2 page.

This allows more than 8 MiB of modules to be loaded by loader, e.g. zfs.ko
and opensolaris.ko.

Reported by: Shawn Webb
MFC after: 1 week
Sponsored by: DARPA, AFRL

6 years agoPrint the correct value when freelist is out of range.
Andrew Turner [Mon, 4 Dec 2017 11:16:51 +0000 (11:16 +0000)]
Print the correct value when freelist is out of range.

Security: :
Sponsored by: DARPA, AFRL

6 years agoProperly name the 2013 edition
Baptiste Daroussin [Mon, 4 Dec 2017 09:58:38 +0000 (09:58 +0000)]
Properly name the 2013 edition

Reported by: ed

6 years agoAdd Posix 2013 référence for manpages
Baptiste Daroussin [Mon, 4 Dec 2017 09:48:55 +0000 (09:48 +0000)]
Add Posix 2013 référence for manpages

PR: 223930
Reported by: Mateusz Piotrowski <mpp302@gmail.com>
MFC after: 2 days

6 years agoFix format string warning with enabled DEBUGGING.
Andrey V. Elsukov [Mon, 4 Dec 2017 09:17:28 +0000 (09:17 +0000)]
Fix format string warning with enabled DEBUGGING.

MFC after: 1 week

6 years agoloader.efi: add note about iPXE into the efipart.c
Toomas Soome [Mon, 4 Dec 2017 08:50:00 +0000 (08:50 +0000)]
loader.efi: add note about iPXE into the efipart.c

Commant update.

6 years ago[mips] [vm] restore translation of freelist to flind for page allocation
Michael Zhilin [Mon, 4 Dec 2017 08:08:55 +0000 (08:08 +0000)]
[mips] [vm] restore translation of freelist to flind for page allocation

Commit r326346 moved domain iterators from physical layer to vm_page one,
but it also removed translation of freelist to flind for
vm_page_alloc_freelist() call. Before it expects VM_FREELIST_ parameter,
but after it expect freelist index.

On small WiFi boxes with few megabytes of RAM, there is only one freelist
VM_FREELIST_LOWMEM (1) and there is no VM_FREELIST_DEFAULT(0) (see file
sys/mips/include/vmparam.h). It results in freelist 1 with flind 0.

At first, this commit renames flind to freelist in vm_page_alloc_freelist
to avoid misunderstanding about input parameters. Then on physical layer it
restores translation for correct handling of freelist parameter.

Reported by: landonf
Reviewed by: jeff
Differential Revision: https://reviews.freebsd.org/D13351

6 years agoincrease maximum size of zfsboot
Allan Jude [Mon, 4 Dec 2017 02:42:00 +0000 (02:42 +0000)]
increase maximum size of zfsboot

Previous to the switch from sys/boot to stand/ zfsboot (used for MBR) did
not support GELI. Now that it is compiled with GELI, it is running out of
space.

zfsldr (which loads zfsboot) was modified to load 256kb in r304321

6 years agoUse __has_builtin() to ensure clz and clzll builtins are available
Allan Jude [Mon, 4 Dec 2017 01:16:26 +0000 (01:16 +0000)]
Use __has_builtin() to ensure clz and clzll builtins are available

The existing check of the GCC version number is not sufficient

This fixes the build on sparc64 in preparation for integrating ZSTD into
the kernel for ZFS and Crash Dumps.

6 years agoRemove the entire objdir tree to avoid picking up stale binaries from
Warner Losh [Mon, 4 Dec 2017 01:14:17 +0000 (01:14 +0000)]
Remove the entire objdir tree to avoid picking up stale binaries from
prior builds. Move GELI to building first.

Sponsored by: Netflix

6 years agoSwitch to proper MK_LOADER_GELI tests.
Warner Losh [Mon, 4 Dec 2017 01:14:12 +0000 (01:14 +0000)]
Switch to proper MK_LOADER_GELI tests.

Submitted by: peter@

6 years agoAdd support for RealTek 8812 over USB
George V. Neville-Neil [Sun, 3 Dec 2017 22:02:30 +0000 (22:02 +0000)]
Add support for RealTek 8812 over USB

Tested with ALFA AWUS036ACH

MFC after: 1 week

6 years agoDocument the sys/boot -> stand move in hier.7 and the top-level README.
Mark Johnston [Sun, 3 Dec 2017 20:36:36 +0000 (20:36 +0000)]
Document the sys/boot -> stand move in hier.7 and the top-level README.

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

6 years agoMake COMPAT_FREEBSD32 part of GENERIC on arm64.
Ed Schouten [Sun, 3 Dec 2017 19:26:14 +0000 (19:26 +0000)]
Make COMPAT_FREEBSD32 part of GENERIC on arm64.

The cloudabi32.ko kernel modules can only be loaded on AMD64 and ARM64
by kernels built with COMPAT_FREEBSD32. Even though COMPAT_FREEBSD32
does not support the execution of native FreeBSD executables, do add it
to GENERIC, to make cloudabi32.ko usable.

According to size(1), this makes the kernel image approximately 0.7%
larger.

Reviewed by: andrew, imp, emaste
Differential Revision: https://reviews.freebsd.org/D13311

6 years agotests: ipsec: Don't load/unload aesni.ko in the test header
Kristof Provost [Sun, 3 Dec 2017 18:35:07 +0000 (18:35 +0000)]
tests: ipsec: Don't load/unload aesni.ko in the test header

We can't kldunload in the test head as Kyua interprets any output from
them. This would lead to syntax errors and skipping the entire file.

Move the kld commands into the test case bodies.

Pointed out by: asomers@

6 years agoComplete support for dtrace's -x setenv option.
Mark Johnston [Sun, 3 Dec 2017 16:57:28 +0000 (16:57 +0000)]
Complete support for dtrace's -x setenv option.

This allows one to override the environment for processes created with
dtrace -c. By default, the environment is inherited.

This support was originally merged from illumos in r249367 but was lost
when the commit was later reverted and then brought back piecemeal.

Reported by: Samuel Lepetit <slepetit@apple.com>
MFC after: 2 weeks

6 years agoAdd an envp argument to proc_create().
Mark Johnston [Sun, 3 Dec 2017 16:50:16 +0000 (16:50 +0000)]
Add an envp argument to proc_create().

This is needed to support dtrace's -x setenv option.

MFC after: 2 weeks

6 years agoAdd IPSec tests in tunnel mode
Kristof Provost [Sun, 3 Dec 2017 13:52:35 +0000 (13:52 +0000)]
Add IPSec tests in tunnel mode

Some IPSec in tunnel mode allowing to test multiple IPSec
configurations.  These tests are reusing the jail/vnet scripts from pf
tests for generating complex network.

Submitted by: olivier@
Differential Revision: https://reviews.freebsd.org/D13017

6 years agoUpgrade our copies of clang, llvm, lldb and libc++ to r319231 from the
Dimitry Andric [Sun, 3 Dec 2017 12:14:34 +0000 (12:14 +0000)]
Upgrade our copies of clang, llvm, lldb and libc++ to r319231 from the
upstream release_50 branch.  This corresponds to 5.0.1 rc2.

MFC after: 2 weeks

6 years agoNow it's safe to bump WARNS to 1.
Warner Losh [Sun, 3 Dec 2017 04:55:38 +0000 (04:55 +0000)]
Now it's safe to bump WARNS to 1.

Sponsored by: Netflix

6 years agoMark two things as unused (since they are only sometimes used) and
Warner Losh [Sun, 3 Dec 2017 04:55:33 +0000 (04:55 +0000)]
Mark two things as unused (since they are only sometimes used) and
toss in a DECONST to remove a const in some tricky code that would
require too extensive a change to unwind otherwise.

Sponsored by: Netflix

6 years agoProvide a md_load64 prototype.
Warner Losh [Sun, 3 Dec 2017 04:55:28 +0000 (04:55 +0000)]
Provide a md_load64 prototype.

Sponsored by: Netflix

6 years agoCast void * pointer to char * so the arg matches the %s format.
Warner Losh [Sun, 3 Dec 2017 04:55:23 +0000 (04:55 +0000)]
Cast void * pointer to char * so the arg matches the %s format.

Sponsored by: Netflix

6 years agoDisconnet ps3 from the build. There's too many warnings to fix. Also,
Warner Losh [Sun, 3 Dec 2017 04:55:19 +0000 (04:55 +0000)]
Disconnet ps3 from the build. There's too many warnings to fix. Also,
it's going to be removed soon anyway once the final lingering issues
with kboot are resolved. Go ahead and disconnect it from the build a
little early.

Sponsored by: Netflix
OK'd by: nathanw@

6 years agoDeclare our strange brand of main().
Warner Losh [Sun, 3 Dec 2017 04:55:14 +0000 (04:55 +0000)]
Declare our strange brand of main().

Sponsored by: Netflix

6 years agoAllow this file to be used in libsa without warning...
Warner Losh [Sun, 3 Dec 2017 04:55:09 +0000 (04:55 +0000)]
Allow this file to be used in libsa without warning...

Sponsored by: Netflix