Commit Graph

233137 Commits

Author SHA1 Message Date
Alan Somers
d91dccb1f5 auditpipe(4): fix some ioctl arguments in the man page
Fix the argument types for the AUDITPIPE_[GS]ET_PRESELECT_(NA)?FLAGS ioctls.
Also, fix some grammar.

[skip ci]

PR:		226713
Submitted by:	aniketp
MFC after:	2 weeks
Sponsored by:	Google, Inc. (GSoC 2018)
Differential Revision:	https://reviews.freebsd.org/D15620
2018-05-30 19:57:15 +00:00
Ed Maste
f4c84137f9 Regen src.conf.5 after r334391 - LLD_IS_LD default on amd64
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2018-05-30 18:34:45 +00:00
Ed Maste
1bf8f95706 Enable lld as the system linker by default on amd64
The migration to LLVM's lld linker has been in progress for quite some
time - about three years ago I opened an upstream LLVM meta-bug to track
issues using lld as FreeBSD's linker, and about 1.5 years ago requested
the first exp-run with lld as the system linker.

As of r327783 we enabled LLD_BOOTSTRAP by default on amd64, using lld as
the linker to link the kernel and world, but GNU ld was still installed
as /usr/bin/ld.

The vast majority of issues observed when building ports with lld as the
system linker have now been solved, so set LLD_IS_LD by default on amd64
and install lld as /usr/bin/ld.  A small number of port failures remain
and these will be addressed in the near future.

Thanks to antoine@ for handling the exp-runs, krion@ for investigating
many port failures and adding LLD_UNSAFE or other fixes or workarounds,
and everyone who helped investigate, fix or tag ports.

PR:		214864 (exp-run)
Sponsored by:	The FreeBSD Foundation
2018-05-30 18:04:25 +00:00
Alan Somers
b3bc3d7925 au_read_rec(3): correct return value in man page
Submitted by:	aniketp
Reviewed by:	csjp (earlier version)
MFC after:	2 weeks
Sponsored by:	Google, Inc. (GSoC 2018)
Differential Revision:	https://reviews.freebsd.org/D15618
2018-05-30 17:05:48 +00:00
Mark Johnston
6939b4d3b4 Typo.
PR:		228533
Submitted by:	Jakub Piecuch <j.piecuch96@gmail.com>
MFC after:	1 week
2018-05-30 16:48:48 +00:00
Alan Somers
6570d61a59 Fix OpenBSM with GCC with -Wredundant-decls
Upstream change ed47534 consciously added some redundant functional
declarations, and I'm not sure why. AFAICT they were never required. On
FreeBSD, they break the build with GCC (but not Clang) for any program
including libbsm.h with WARNS=6.

Fix by cherry-picking upstream change
https://github.com/openbsm/openbsm/commit/0553c27

Reported by:	emaste
Reviewed by:	cem
Obtained from:	OpenBSM
MFC after:	2 weeks
Pull Request:	https://github.com/openbsm/openbsm/pull/31
2018-05-30 15:51:48 +00:00
Andrew Turner
9b56058160 Remove max_pa, it's unused.
Sponsored by:	DARPA, AFRL
2018-05-30 15:37:09 +00:00
Emmanuel Vadot
0194dcd7a9 regulator: Fix typo (shuting/shutting)
Submitted by:	Jose Luis Duran (github pull #151)
2018-05-30 15:32:31 +00:00
Andrew Turner
e2b8bf0a18 Further limit when we call pmap_fault.
We should only call pmap_fault in the kernel when accessing a userspace
address. As this should always happen through specific functions that set
a fault handler we can use this to limit calls to pmap_fault to when this
is set.

This should help with NULL pointer dereferences when we are unable to sleep
so we fall into the correct case.

Sponsored by:	DARPA, AFRL
2018-05-30 15:25:48 +00:00
Warner Losh
b98d2b35df devinfo_init() returns an errno, but doesn't set errno, so the error
message when it fails reflects some random thing rather than what it
returned. Set errno to the return value.
2018-05-30 15:08:59 +00:00
Warner Losh
51a9cfbf60 There's no meaningful errno when there's a version mismatch, so use
warnx. Also, report the mis-matched versions.
2018-05-30 15:08:46 +00:00
Andrew Turner
abf7742a1c Push down the locking in pmap_fault to just be around the calls to
arm64_address_translate_*. There is no need to lock around the switch
statement as we only care about a few cases.

Sponsored by:	DARPA, AFRL
2018-05-30 14:18:19 +00:00
Ed Maste
5dbe22000d makeroot.sh: allow duplicate entries even with -f <filelist>
makefs disallows duplicate entries unless the -D option is specified.

Previously makeroot.sh enabled -D unless a filelist was provided via
the -f options.  The filelist logic creates an mtree manifest from the
METALOG and the provided filelist by passing them through `sort -u`,
so duplicates were not expected.  However, duplicates can still occur
when a directory appears in multiple packages -- for example,

./etc/pam.d type=dir uname=root gname=wheel mode=0755
./etc/pam.d type=dir mode=0755 tags=package=runtime
./etc/pam.d type=dir mode=0755 tags=package=at
./etc/pam.d type=dir mode=0755 tags=package=ftp
./etc/pam.d type=dir mode=0755 tags=package=telnet

For the purposes of makefs these directory entries are identical, but
are of course not identical for sort -u.

For now just leave the allow duplicates -D flag enabled.

PR:		228606
Sponsored by:	The FreeBSD Foundation
2018-05-30 13:51:00 +00:00
Ed Maste
f912a970e6 link_elf_obj: correct an error message
Previously we'd report that a file has "no valid symbol table" if it in
fact had two or more.  Change the message to report that there must be
exactly one.
2018-05-30 12:55:27 +00:00
Kristof Provost
d25c25dc52 pf: Add missing include statement
rmlocks require <sys/lock.h> as well as <sys/rmlock.h>.
Unbreak mips build.
2018-05-30 12:40:37 +00:00
Hans Petter Selasky
65b806b289 Hide unsupported remote capture definitions to avoid breakage in ports.
Suggested by:	antoine@
MFC after:	3 weeks
Sponsored by:	Mellanox Technologies
2018-05-30 11:45:29 +00:00
Hans Petter Selasky
7cf2653c60 Remove redundant header file from source list in libpcap.
MFC after:	3 weeks
Sponsored by:	Mellanox Technologies
2018-05-30 08:24:57 +00:00
Kristof Provost
455969d305 pf: Replace rwlock on PF_RULES_LOCK with rmlock
Given that PF_RULES_LOCK is a mostly read lock, replace the rwlock with rmlock.
This change improves packet processing rate in high pps environments.
Benchmarking by olivier@ shows a 65% improvement in pps.

While here, also eliminate all appearances of "sys/rwlock.h" includes since it
is not used anymore.

Submitted by:	farrokhi@
Differential Revision:	https://reviews.freebsd.org/D15502
2018-05-30 07:11:33 +00:00
Matt Macy
02ce8216df hwpmc: remove stale assert
Reported by:	eadler
2018-05-30 06:29:22 +00:00
Warner Losh
212967ff26 We've removed the special case code for upgrading from FreeBSD 9 so
remove the special warning. It's in svn if we need it.
2018-05-30 05:00:30 +00:00
Nathan Whitehorn
452a74bfee If linebytes property is missing from the graphics device, assume no
overscan and synthesize it from the display depth and screen width.
This may not be right, but it sometimes right and is better than
returning CN_DEAD.
2018-05-30 04:15:33 +00:00
Matt Macy
8ffdc5df52 libpmc: squelch valgrind warnings 2018-05-30 04:12:51 +00:00
Justin Hibbits
5e91185bb1 Protect dtrace_getpcstack() from a NULL stack pointer in a trap frame
Found when trying to use lockstat on a POWER9, the stack pointer (r1) could
be NULL, and result in a NULL pointer dereference, crashing the kernel.
2018-05-30 03:48:27 +00:00
Matt Macy
8b20f97570 libpmc: bring pmu_util closer in line with style(9) 2018-05-30 03:40:02 +00:00
Matt Macy
e445381f13 epoch(9): make epoch closer to style(9) 2018-05-30 03:39:57 +00:00
Justin Hibbits
dceea51efe Make opal_pci driver work with POWER9
Summary:
Coupled with r334365, this makes PCI work on POWER9.  There is still more to
do to fully exploit the hardware capabilities, but this is sufficient to
enable USB and ethernet controllers on a POWER9 Talos II system.

Reviewed by:	nwhitehorn, leitao
Differential Revision: https://reviews.freebsd.org/D15566
2018-05-30 03:00:57 +00:00
Justin Hibbits
f07ee2a7c0 Cache the phandle of the PCI node in opal_pci_attach
Simple cleanup, no functional change.  This is related to the fixups needed
for POWER9 support.
2018-05-30 02:47:23 +00:00
Justin Hibbits
8b92ad4371 Restrict PCIe maxslots to 0, instead of PCI_SLOTMAX
Summary:
PCIe only permits 1 device on an endpoint, so some devices ignore the device
part of B:D:F probing.  Although ARI likely fixes this, not all platforms
support ARI completely or correctly, so some devices end up showing up 32
times on the bus.

This was found during bringup of POWER9/Talos, and has been tested on POWER9
and POWER8 hardware.

Reviewed by:	leitao
Differential Revision: https://reviews.freebsd.org/D15461
2018-05-30 02:41:47 +00:00
Ravi Pokala
549bb844cf Remove the mlx5 driver from LINT kernel config for 32-bit PPC
The mlx5 driver requires 64-bit atomics, which are not supported on 32-bit
PPC. Exclude that driver from the LINT kernel config.

Submitted by:	hps (but I re-worded the comment)
Reported by:	rpokala
Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D15611
2018-05-30 02:26:36 +00:00
Ed Maste
f37e7f527b elfdump: chase ABI tag note name change from r232832
r232832 changed the ABI tag note name from .note.ABI-tag to .note.tag.
Follow suit in elfdump.

Elfdump's note parsing is very basic and should be significantly
reworked, but for now just restore the broken functionality.

PR:		228290
Submitted by:	martin at lispworks.com
MFC after:	1 week
2018-05-30 01:16:50 +00:00
Ed Maste
16b88f72f7 Temporarily disconnect audit tests
Audit tests added in r334360 broke the build on a number of archs.
Remove the subdir from the top level tests/sys/Makefile until they're
fixed.
2018-05-30 00:36:58 +00:00
Matt Macy
82c78f803d pmc: don't break build with format issues 2018-05-30 00:06:17 +00:00
Alan Somers
f7f4e0f7a8 Add initial set of tests for audit(4)
This change includes the framework for testing the auditability of various
syscalls, and includes changes for the first 12.  The tests will start
auditd(8) if needed, though they'll be much faster if it's already running.
The syscalls tested in this commit include mkdir(2), mkdirat(2), mknod(2),
mknodat(2), mkfifo(2), mkfifoat(2), link(2), linkat(2), symlink(2),
symlinkat(2), rename(2), and renameat(2).

Submitted by:	aniketp
MFC after:	2 weeks
Sponsored by:	Google, Inc (GSoC 2018)
Differential Revision:	https://reviews.freebsd.org/D15286
2018-05-29 23:08:33 +00:00
Devin Teske
7d958cc9aa dwatch(1): Fix "-t test" for post-processing profiles
Profiles that perform post-processing of the DTrace output were
dropping the "-t test" option on the floor. Fix handling of this
option for said profiles.

X-MFC-to:	stable/11
X-MFC-with:	r334261-334262
Sponsored by:	Smule, Inc.
2018-05-29 22:36:37 +00:00
Stephen Hurd
3e0e6330b5 iflib: mark irq allocation name parameter as constant
The *name parameter passed to iflib_irq_alloc_generic and
iflib_softirq_alloc_generic is never modified. Many places in code pass
string literals and thus should not be modified.

Mark the *name parameter as a const char * instead, so that we enforce
that the name is not modified before passing to bus_describe_intr()

Submitted by:	Jacob Keller <jacob.e.keller@intel.com>
Reviewed by:	kmacy
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D15343
2018-05-29 21:56:39 +00:00
Sean Bruno
21a8e0b1d5 dumpon(8)
- fix the WITHOUT_CRYPTO buildworld case.  Its rare, but some of us do
  build this way.

Sponsored by:	Limelight Networks
2018-05-29 21:52:13 +00:00
Gleb Smirnoff
147cd40fe7 Revert second chunk of r333860. The warning from gcc is false positive. The
npages won't be ever used in no space case.
2018-05-29 21:45:15 +00:00
Matt Macy
8bed125da7 libpmc: silence scan-build warnings 2018-05-29 21:02:13 +00:00
Matt Macy
5244f3c6ae pmc: silence scan-build warnings 2018-05-29 21:02:08 +00:00
Eric van Gyzen
4f9b4ac4c2 pmc_annotate: adhere to the API
If the 'mode' parameter was invalid, pmc_annotate() would
return EINVAL instead of setting errno and returning -1.

Sponsored by:	Dell EMC
2018-05-29 20:30:46 +00:00
Matt Macy
3554f22e67 pmc: Add new sub-command structured "pmc" utility
This will manage pmc functionality with a more
manageable structure of subcommands rather than the
gradually accreted spaghetti logic of overlapping flags
that exists in pmcstat.

This is intended to ultimately have all the same functionality
as pmcannotate+pmccontrol+pmcstat. Currently it just has
"stat" and "system-stat" - counters for the process itself and counters
for the system as a whole respectively (i.e. system-stat includes kernel
threads). Note that the rusage results (page faults/context switches/
user/sys) for stat-system will not account for the system as a whole -
only for the child process specified on the command line.

Implementing stat was suggested by mjg@ and the output is based on that
from Linux's "perf stat".

% pmc stat -- make -j32 buildkernel -DNO_MODULES  -ss > /dev/null
         9598393  page faults           #       0.674 M/sec
          387085  voluntary csw         #       0.027 M/sec
          106989  involuntary csw       #       0.008 M/sec
   2763965982317  cycles
   2542953049760  instructions          #       0.920 inst/cycle
    511562750157  branches
     12917006881  branch-misses         #       2.525%
     17944429878  cache-references      #       0.007 refs/inst
      2205119560  cache-misses          #       12.289%
           43.74  real                  #       2019.72% cpu
          795.09  user                  #       1817.72% cpu
           88.35  sys                   #       202.00% cpu

% make -j32 buildkernel -DNO_MODULES  -ss > /dev/null &
% sudo pmc stat-system cat
^C             103  page faults         #       0.811 M/sec
               4  voluntary csw         #       0.031 M/sec
               0  involuntary csw       #       0.000 M/sec
   2843639070514  cycles
   2606171217438  instructions          #       0.916 inst/cycle
    522450422783  branches
     13092862839  branch-misses         #       2.506%
     18592101113  cache-references      #       0.007 refs/inst
      2562878667  cache-misses          #       13.785%
           44.85  real                  #       0.00% cpu
            0.00  user                  #       0.00% cpu
            0.00  sys                   #       0.00% cpu
2018-05-29 20:28:34 +00:00
Matt Macy
1a32aa0ff7 libpmc: don't return -1 on success in pmc_allocate 2018-05-29 20:09:35 +00:00
Brooks Davis
cbf7e0cba7 Correct pointer subtraction in KASSERT().
The assertion would never fire without truly spectacular future
programming errors.

Reported by:	Coverity
CID:		1391370
Sponsored by:	DARPA, AFRL
2018-05-29 20:03:24 +00:00
Matt Macy
ed50b91880 libpmc: don't leak string in error case either
Reported by:	vangyzen@
2018-05-29 19:07:00 +00:00
Matt Macy
c53c63f67e libpmc: remove fixed counter diagnostic 2018-05-29 18:30:37 +00:00
Matt Macy
731ca83529 libpmc: free allocated string on return from pmc_allocate
Reported by:	Coverity
CID: 1391359
2018-05-29 18:26:12 +00:00
Matt Macy
b99aa0fbb2 hwpmc: don't enter epoch section across mmap hook 2018-05-29 18:03:48 +00:00
Matt Macy
6c3c319414 iflib: hold context lock across detach for drivers that need it 2018-05-29 18:03:43 +00:00
Brooks Davis
d8b2f0790b Correct pointer subtraction in KASSERT().
The assertion would never fire without truly spectacular future
programming errors.

Reported by:	Coverity
CID:		1391367, 1391368
Sponsored by:	DARPA, AFRL
2018-05-29 17:49:03 +00:00
Andrew Turner
c0fd148b5d Increase the number of fdt memory regions we support to 16. Some SoCs have
many excluded regions causing a buffer overflow in the early boot code if
this value is too small.

Obtained from:	ABT Systems Ltd
Sponsored by:	Turing Robotic Industries
2018-05-29 17:44:40 +00:00