r356857 bdragon Jan. 18, 2020, 1:22 a.m.
It turns out the maximum TLB1 page size on e5500 is 4G, despite the format
being defined for up to 1TB.

So, we need to clamp the DMAP TLB1 entries to not attempt to create 16G or
larger entries.

Fixes boot on my X5000 in which I just installed 16G of RAM.

Reviewed by:	jhibbits
Sponsored by:	Tag1 Consulting, Inc.
Differential Revision:	https://reviews.freebsd.org/D23244
r356856 bdragon Jan. 17, 2020, 11:41 p.m.
In r291668, an instruction was added to sigcode64.S without the nop pad at
the end being taken out.

Due to alignment, this means that a dword is being wasted on the shared
page for no reason.

Take out this nop, and add some comments while I'm here.

Reviewed by:	jhibbits
Sponsored by:	Tag1 Consulting, Inc.
Differential Revision:	https://reviews.freebsd.org/D23055
r356855 woodsb02 Jan. 17, 2020, 10:26 p.m.
This resulted in the partitioning step failing if either of the
"Auto (UFS)" or "Manual" options were selected.

Reason: partedit was attempting to open a directory (TMPDIR) read/write,
which resulted in errno(2) 21 - EISDIR - Is a directory.

Reported by:	Clay Daniels <clay.daniels.jr@gmail.com>
Reviewed by:	Ryan Moeller <ryan@freqlabs.com>
Approved by:	emaste, bcran
Differential Revision:	https://reviews.freebsd.org/D23232
r356852 cem Jan. 17, 2020, 10:04 p.m.
This makes amrr_node_stats() cleaner and allows the rate printing to be

Submitted by:	Neel Chauhan <neel at neelc.org>
Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D22318
r356849 kevans Jan. 17, 2020, 9:39 p.m.
Raspberry Pi are all over the board, and the reality is that there's no harm
in including all of the definitions by default but plenty of harm in the
current situation. This change is safe because we match a definition by root
/compatible in the FDT, so there will be no false-positives because of it.

The main array of definitions grows, but it's only walked exactly once to
determine which we need to use.
r356840 jhb Jan. 17, 2020, 7:13 p.m.
Previously, this check was only in sys_sigreturn() which meant that
user applications could write invalid values to the register via
setcontext() or swapcontext().

Reviewed by:	mhorne
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23219
r356839 jhb Jan. 17, 2020, 7:01 p.m.
arm64 and riscv were only saving and restoring floating point
registers for sendsig() and sys_sigreturn(), but not for getcontext(),
setcontext(), and swapcontext().

While here, remove an always-false check for uap being NULL from

Reviewed by:	br, mhorne
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23218
r356837 emaste Jan. 17, 2020, 5:56 p.m.
r356836 emaste Jan. 17, 2020, 5:53 p.m.
dma(8) depends on OpenSSL unconditionally.

Reported by:	Michael Dexter's Build Options Survey run
MFC after:	1 weeks
Sponsored by:	The FreeBSD Foundation
r356835 mhorne Jan. 17, 2020, 5:03 p.m.
As part of the RISC-V ABI, the gp register is expected to initialized
with the address of __global_pointer$ as early as possible. This allows
loads and stores from .sdata to be relaxed based on the value of gp. In
locore.S we do this initialization twice, once each for va and mpva.
However, in both cases the initialization is preceded by an la
instruction, which in theory could be relaxed by the linker.

Move the initialization of gp to be slightly earlier (before la
cpu_exception_handler), and add an additional gp initialization at the
very beginning of _start, before virtual memory is set up.

Reported by:	jrtc27
Reviewed by:	jrtc27
Differential Revision:	https://reviews.freebsd.org/D23139
r356834 br Jan. 17, 2020, 4:48 p.m.
as these functions should do zero-extend.

Discovered by running pci_read_cap(), and by hint from James Clarke.

Reviewed by:	James Clarke <jrtc27@jrtc27.com>
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D23236
r356832 mjg Jan. 17, 2020, 3:45 p.m.
Apparently building with 'cd lib/libc; make all install' is not the same
as buildworld.

Reported by:	Michael Butler
r356831 luporl Jan. 17, 2020, 2:43 p.m.
pcb_context[20] holds r12-r31 and not r14-r31, as the comment said.
r356830 mjg Jan. 17, 2020, 2:42 p.m.
Prior to introduction of this op libc's readdir would call fstatfs(2), in
effect unnecessarily copying kilobytes of data just to check fs name and a
mount flag.

Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D23162
r356829 mjg Jan. 17, 2020, 2:40 p.m.
The failure is not really expected, but should it happen it's better to
get some data.

Suggested by:	kib