Commit Graph

242861 Commits

Author SHA1 Message Date
Alexander Motin
c1264e76cd Properly report ACS revisions alike to kernel.
MFC after:	2 weeks
2019-07-19 20:02:01 +00:00
Alexander Motin
89b35a5274 Add Accessible Max Address Configuration support to camcontrol.
AMA replaced HPA in ACS-3 specification.  It allows to limit size of the
disk alike to HPA, but declares inaccessible data as indeterminate.  One
of its practical use cases is to under-provision SATA SSDs for better
reliability and performance.

While there, fix HPA Security detection/reporting.

MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
2019-07-19 19:15:08 +00:00
Brooks Davis
4ca9bcd650 Restore WARNS?=1 here. I missed that libexec/bootpd/bootpgw existed. 2019-07-19 18:47:13 +00:00
Warner Losh
5e83c2ffaa Keep track of the number of commands that exhaust their retry limit.
While we print failure messages on the console, sometimes logs are lost or
overwhelmed. Keeping a count of how many times we've failed retriable commands
helps get a magnitude of the problem.
2019-07-19 18:39:24 +00:00
Warner Losh
c37fc318c4 Keep track of the number of retried commands.
Retried commands can indicate a performance degredation of an nvme drive. Keep
track of the number of retries and report it out via sysctl, just like number of
commands an interrupts.
2019-07-19 18:39:18 +00:00
Warner Losh
710becdd96 Remove pre-FreeBSD 7.0 compatibility. 2019-07-19 18:38:47 +00:00
Brooks Davis
df7a21a703 Chain Makefile.inc's so default are inherited as expected.
Remove unneeded or duplicate variables.

No functional change.

Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
2019-07-19 17:52:23 +00:00
Warner Losh
eec0e91e05 Add comments about KERN_OPT here. 2019-07-19 17:48:29 +00:00
Emmanuel Vadot
1d6d0a43ce pkgbase: move man pages from runtime-manual to runtime
We don't split the other man pages in their own package so do the same for runtime.

Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D20962
2019-07-19 15:12:20 +00:00
Emmanuel Vadot
5c5ed48a03 bsd.confs.mk: Test the correct value for the destination package
Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D20961
2019-07-19 15:11:32 +00:00
Emmanuel Vadot
be6a4fc664 pkgbase: Add a FreeBSD-dpv package
Move the dpv related files from FreeBSD-runtime to a new package named
FreeBSD-dpv
The only consumer is bsdinstall which is already in it's own package.

Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D20960
2019-07-19 15:10:53 +00:00
Emmanuel Vadot
9553ea80a8 pkgbase: Add a FreeBSD-bluetooth package
Move the bluetooth related files from FreeBSD-runtime to a new package named
FreeBSD-bluetooth
The FreeBSD runtime is only intended to have everything for a working
FreeBSD installation and bluetooth isn't needed for that.

Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D20959
2019-07-19 15:10:03 +00:00
Emmanuel Vadot
1ba153e085 pkgbase: Add a FreeBSD-hostapd package
Move the hostapd related files from FreeBSD-runtime to a new package n
FreeBSD-hostapd
The FreeBSD runtime is only intended to have everything for a working
FreeBSD installation and hostapd isn't needed for that.

Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D20958
2019-07-19 15:09:00 +00:00
Emmanuel Vadot
d4335dcc83 pkgbase: Add a FreeBSD-wpa package
Move the wpa related files from FreeBSD-runtime to a new package named
FreeBSD-wpa
The FreeBSD runtime is only intended to have everything for a working
FreeBSD installation and wpa isn't needed for that.

Reviewed by:    bapt, gjb
Differential Revision:  https://reviews.freebsd.org/D20957
2019-07-19 15:07:30 +00:00
Warner Losh
1071b50a65 Use sysctl + CTLRWTUN for hw.nvme.verbose_cmd_dump.
Also convert it to a bool. While the rest of the driver isn't yet bool clean,
this will help.

Reviewed by: cem@
Differential Revision: https://reviews.freebsd.org/D20988
2019-07-19 00:32:56 +00:00
Bryan Drewery
000a2e7040 Rework some multi-output target dependency handling.
This reworks my last commit in r301285 to more closely match what was in
r241298 (but reverted in r294878).

This is addressing "missing .meta file" rebuilds but also ensuring that
files are always generated when needed in each case.

Note that this is not a complete rework of the problem areas identified
in r301285 as most are "good enough" right now as the new pattern
is too verbose. It's only worth making this current change where headers
may be generated in the INCS list; where missing .meta file rebuilds are
spotted.

--- Technical details follow ---

Several attempts to deal with this problem of multi-output targets, with and
without META MODE, were explained in r241298, r294878, and r301285.

The general problem is with multi-output targets such as:
        foo.c foo.h:
                touch foo.c foo.h
        foo.c foo.h:
                touch foo.c
                touch foo.h
        foo.c foo.h: foo.in
                ./generator ${.ALLSRC}

This pattern is problematic in jobs mode as both files end up being
built concurrently and leads to races. With META MODE it is worse
as both targets end up rebuilding if they lack a .meta file. So the
generator is force built twice even though it is only needed once.
There are also problems in that 'make foo.h' may be ran before 'make foo.c';
The order of make generating the targets is not guaranteed.

An older attempted workaround to this (discussed in r294878) was:
        foo.h: foo.c
        foo.c: foo.in
                ./generator ${.ALLSRC}
This appears fine except that if foo.h is missing and foo.c exists then
foo.h will never be regenerated. This pattern is close to the solution
in this commit though:

        foo.h: foo.c .NOMETA
        .if !exists(foo.h)
        foo.c: .PHONY .META
        .endif
        foo.c: foo.in
                ./generator ${.ALLSRC}

There's 2 differences here:
1. foo.h will never expect to have a .meta file since the foo.c target
   will generate both and own the .meta file.
2. If foo.h does not exist then it needs to force foo.c to be rebuilt
   with .PHONY. That normally disables META MODE though so .META is
   given to tell bmake we do really expect a .meta file.

This pattern cannot work with implicit suffix rules since the .c and .h files
may be generated at different times (buildincludes vs depend/all).

Sponsored by:	Dell EMC
MFC after:	2 weeks
2019-07-19 00:15:25 +00:00
Warner Losh
c75bdc044d Provide new tunable hw.nvme.verbose_cmd_dump
The nvme drive dumps only the most relevant details about a command when it
fails. However, there are times this is not sufficient (such as debugging weird
issues for a new drive with a vendor). Setting hw.nvme.verbose_cmd_dump=1
in loader.conf will enable more complete debugging information about each
command that fails.

Reviewed by: rpokala
Sponsored by: Netflix
Differential Version: https://reviews.freebsd.org/D20988
2019-07-18 21:58:51 +00:00
Brooks Davis
f95dfdbe69 Include a mode when creating files with openat().
Reviewed by:	asomers
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D20989
2019-07-18 21:37:50 +00:00
Brooks Davis
ab9ef34e92 Document that setmode(3) is not thread safe.
In some circumstances, setmode(3) may call umask(2) twice to retrieve
the current mode and then restore it.  Between calls, the process will
have a umask of 0.

Reviewed by:	markj
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D20982
2019-07-18 21:33:55 +00:00
Warner Losh
62d2cf1847 Provide macros to extract the sub-fields of the CAP_LO and CAP_HI registers.
These macros make places where we extract these easier to read. The shift and
mask stuff is also a bit tedious and error prone. Start with the CAP_LO and
CAP_HI registers since their scope is somewhat constrained. This is style
chagne only, no functional changes.

Reviewed by: chuck
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20979
2019-07-18 15:41:10 +00:00
Andrew Turner
f1fbf9c3b1 Rename arm64 macros in preperation for a script to generate them.
I have a script to generate most of the ID_AA64* macros from the Arm
XML source [1]. In preperation for using this we need to clean up the
macros to be in line with what the script will generate. This is the
first step, rename the macros to follow the names in said XML.

[1] https://developer.arm.com/architectures/cpu-architecture/a-profile/exploration-tools

MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D20976
2019-07-18 13:58:04 +00:00
Xin LI
9344e4d738 errno.h is no longer needed as of r340239 so remove it.
No MFC planned as that revision was not merged.
2019-07-18 07:37:26 +00:00
Xin LI
c93b6e5fa2 Remove support for FreeBSD 10.x.
MFC after:	1 month
2019-07-18 07:26:30 +00:00
Ian Lepore
18cd8a2df8 Fix a paste-o, set is212x = false for other chip types. Doh! 2019-07-18 01:37:00 +00:00
Ian Lepore
634a2d26fd Handle the PCF2127 RTC chip the same as PCF2129 when init'ing the chip.
This affects the detection of 24-hour vs AM/PM mode... the ampm bit is in a
different location on 2127 and 2129 chips compared to other nxp rtc chips.
I noticed the 2127 case wasn't being handled correctly when I accidentally
misconfiged my system by claiming my PCF2129 was a 2127.
2019-07-18 01:30:56 +00:00
Cy Schubert
5f34d83b8c MFV r350080:
Update sqlite3-3.28.0 (3280000) --> sqlite3-3.29.0 (3290000)

MFC after:	1 week
2019-07-18 00:27:28 +00:00
Brooks Davis
9fe7ee10d8 Remove redundent decleration of __elf_phdr_match_addr().
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
2019-07-17 23:46:47 +00:00
Brooks Davis
1011a4fe27 Remove a duplicate global (rfc931_timeout).
It is declared here and in rfc931.c and unused here so keep that copy
and discard this one.

Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
2019-07-17 23:43:14 +00:00
Brooks Davis
7d2d393c25 Use headers instead of manual declerations of standard functions and
variables.
2019-07-17 23:36:36 +00:00
Simon J. Gerraty
bbac74ca3c loader: ignore some variable settings if input unverified
libsecureboot can tell us if the most recent file opened was
verfied or not.
If it's state is VE_UNVERIFIED_OK, skip if variable
matches one of the restricted prefixes.

Reviewed by:	stevek
MFC after:	1 week
Sponsored by:	Juniper Networks
Differential Revision:	https://reviews.freebsd.org//D20909
2019-07-17 23:33:14 +00:00
Brooks Davis
068ad27de3 Use ANSI C function definitions and declerations.
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
2019-07-17 23:09:40 +00:00
Kirk McKusick
fdf34aa3a5 The error reported in FS-14-UFS-3 can only happen on UFS/FFS
filesystems that have block pointers that are out-of-range for their
filesystem. These out-of-range block pointers are corrected by
fsck(8) so are only encountered when an unchecked filesystem is
mounted.

A new "untrusted" flag has been added to the generic mount interface
that can be set when mounting media of unknown provenance or integrity.
For example, a daemon that automounts a filesystem on a flash drive
when it is plugged into a system.

This commit adds a test to UFS/FFS that validates all block numbers
before using them. Because checking for out-of-range blocks adds
unnecessary overhead to normal operation, the tests are only done
when the filesystem is mounted as an "untrusted" filesystem.

Reported by:  Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as:  FS-14-UFS-3: Out of bounds read in write-2 (ffs_alloccg)
Reviewed by:  kib
Sponsored by: Netflix
2019-07-17 22:07:43 +00:00
Kristof Provost
cd7795a5a4 riscv: Return vm_paddr_t in pmap_early_vtophys()
We can't use a u_int to compute the physical address in
pmap_early_vtophys(). Our int is 32-bit, but the physical address is
64-bit. This works fine if everything lives in below 0x100000000, but as
soon as it doesn't this breaks.

MFC after:	1 week
Sponsored by:	Axiado
2019-07-17 21:25:26 +00:00
Warner Losh
204498d7c2 Remove now-obsolete comment. 2019-07-17 20:43:14 +00:00
Konstantin Belousov
345e740a1b bsearch.3: Improve the example.
Submitted by:	fernape
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D19902
2019-07-17 19:29:55 +00:00
Mark Johnston
c73bd00a14 Remove an old warning from UPDATING.
The clang switchover happened long enough ago that we can
garbage-collect this note.

Reviewed by:	emaste, imp
Differential Revision:	https://reviews.freebsd.org/D20978
2019-07-17 19:11:24 +00:00
Mark Johnston
8dbc2b6e02 Add an initial RELNOTES file.
The intent is to provide a convenient location to document changes
that are relevant to users of binary FreeBSD distributions, in contrast
with UPDATING, which exists to document caveats for users who build
FreeBSD from source.

This complements the "Relnotes:" tag in commit messages by providing a
place to document the change in more detail, or in case a "Relnotes:"
tag was accidentally omitted.  In particular, "Relnotes:" should be
used if you do not intend to document the change in RELNOTES for some
reason.

Changes to the file should not be MFCed.  For now the file will exist
only in head, but may be updated via direct commits to stable branches
depending on how things go.

I took the liberty of pre-populating the file with some recent release
notes-worthy changes.

Reviewed by:	ian (earlier version)
Discussed with:	cy, gjb, imp, rgrimes
Differential Revision:	https://reviews.freebsd.org/D20762
2019-07-17 19:09:05 +00:00
Alan Somers
0122532ee0 F_READAHEAD: Fix r349248's overflow protection, broken by r349391
I accidentally broke the main point of r349248 when making stylistic changes
in r349391.  Restore the original behavior, and also fix an additional
overflow that was possible when uio->uio_resid was nearly SSIZE_MAX.

Reported by:	cem
Reviewed by:	bde
MFC after:	2 weeks
MFC-With:	349248
Sponsored by:	The FreeBSD Foundation
2019-07-17 17:01:07 +00:00
Mark Johnston
0660822abb Remove obsolete compatibility code from rtadvd.
MFC after:	1 week
2019-07-17 16:50:53 +00:00
Mark Johnston
61f2f0bae6 Fix FASTTRAPIOC_GETINSTR.
This ioctl is used when a breakpoint is encountered while disassembling
a symbol in the target process.  Since only one DTrace consumer can
toggle or enumerate fasttrap probes from a given process at time, this
ioctl does not appear to be used in practice.
2019-07-17 16:38:29 +00:00
Mark Johnston
d6eb98610f Reference stdint.h types in ctf.5.
MFC after:	1 week
2019-07-17 16:31:50 +00:00
Cy Schubert
bc6a221d4a Import sqlite3-3.29.0 (3290000) 2019-07-17 14:14:51 +00:00
Thomas Munro
513419f404 tzsetup: upgrade to zone1970.tab
zone.tab is deprecated.  Install zone1970.tab alongside it, and use it
for tzsetup(8).  This is also useful for other applications that need
the modern better maintained file.

Reviewed by: philip
Approved by: allanjude (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20646
2019-07-17 06:17:27 +00:00
Sean Bruno
fceeeec75f I add the ability to accept the default pin widget configuration to help
with various laptops using hdaa(4) sound devices.  We don't seem to know
the "correct" configurations for these devices and the defaults are far
superiour, e.g. they work if you don't nuke the default configs.

PR:	200526
Differential Revision:	https://reviews.freebsd.org/D17772
2019-07-17 04:13:46 +00:00
Chuck Tuffli
31b67520d4 bhyve: update the NVMe CQ based on the status
Instead of skipping the NVMe Completion Queue update based on the
opcode, define a synthetic status value which indicates the completion
queue entry is invalid. This will also allow deferred completion queue
updates for other commands.

Also returns the correct status for unrecognized opcodes ("invalid
opcode").

Reviewed by:	imp, jhb, araujo
Approved by:	imp (mentor), jhb (maintainer)
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D20945
2019-07-17 03:19:30 +00:00
Kevin Lo
a19253bafb More follow-up to r350075, I forgot to update ObsoleteFiles.
Spotted by:	lwhsu
2019-07-17 02:24:16 +00:00
Kevin Lo
ba4ecad9f8 Add an MLINK for igb.
Discussed with:	lwhsu
2019-07-17 02:08:57 +00:00
Kevin Lo
4d302c1a86 Mention iflib(4). 2019-07-17 01:56:40 +00:00
Kirk McKusick
ba554157a3 Style.
No change intended.
2019-07-16 23:39:39 +00:00
Kirk McKusick
1fd136ec5e When a process attempts to allocate space on a full filesystem, a
filesystem full message is sent to the offending process or the
kernel log if the offending process cannot be identified.

To prevent an explotion of messages, the kernel ppsratecheck()
function is used to limit the messages to one per second. This
revision changes the variable that tracks the rate of these messages
from a systemwide limit to a per-filesystem limit by moving it from
a global variable to a variable in the ufsmount structure.

Suggested by: kib
Reviewed by:  kib
Sponsored by: Netflix
2019-07-16 23:12:27 +00:00