Commit graph

4417 commits

Author SHA1 Message Date
Conrad Meyer 266796e885 cryptocheck: Add support for Blake2{B,S} hashes
Since they are not yet present in the version of openssl in base, this will
require installing the ports openssl.

Sponsored by:	Dell EMC Isilon
2018-03-23 05:37:18 +00:00
Conrad Meyer f634b92384 Bring in JHB's cryptocheck tool
It can be used to validate basic algorithm correctness on a variety of inputs,
by comarison to openssl.

While here, add some sanity to the crypto/Makefile.

The tool may not be perfect, but getting it in tree where collaboration can
happen is a nice first step.  The pace of development outside of svn seems
to have slowed down mid-2017.

Obtained from:	github bsdjhb/freebsd:cryptocheck
Sponsored by:	Dell EMC Isilon
2018-03-23 04:31:19 +00:00
Hans Petter Selasky e808190a59 Add kernel and userspace code to dump the firmware state of supported
ConnectX-4/5 devices in mlx5core.

The dump is obtained by reading a predefined register map from the
non-destructive crspace, accessible by the vendor-specific PCIe
capability (VSC). The dump is stored in preallocated kernel memory and
managed by the mlx5tool(8), which communicates with the driver using a
character device node.

The utility allows to store the dump in format
    <address> <value>
into a file, to reset the dump content, and to manually initiate the
dump.

A call to mlx5_fwdump() should be added at the places where a dump
must be fetched automatically. The most likely place is right before a
firmware reset request.

Submitted by:	kib@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-08 15:21:56 +00:00
Kyle Evans a284ff37fc lua-lint: Whitelist cli_execute_unparsed as a global 2018-03-07 18:41:16 +00:00
Kyle Evans 8960f9d7ad Add --globals printc to lua-lint
We provide a global 'printc' as of r330282; make luacheck aware of this fact
so that we can use it without complaints.
2018-03-02 16:51:43 +00:00
Kyle Evans 39dc7a0000 Add descriptions for recently added loader options 2018-03-01 22:00:38 +00:00
Kyle Evans 2f44c5e8e6 Back out r330252; will reapply with an actual commit message 2018-03-01 21:59:30 +00:00
Kyle Evans 04bfa2b7d1 MFC after: 1 week 2018-03-01 21:57:08 +00:00
Kyle Evans df83c04c19 Remove LOADER_EFI description files
LOADER_EFI functionality got folded into EFI as of r330248.
2018-03-01 21:51:20 +00:00
Kyle Evans e8b4b4afe1 Add missing punctuation to *_LOADER_EFI descriptions... 2018-02-28 15:47:24 +00:00
Kyle Evans a5aaa1a800 Some missing LOADER_EFI build option descriptions 2018-02-28 15:28:04 +00:00
Kyle Evans 2fd6cdd032 Add missing WITH_BSD_GREP_FASTMATCH description
MFC after:	3 days
2018-02-28 15:27:36 +00:00
Ed Maste e9093b66d5 Add kernel retpoline option for amd64
Retpoline is a compiler-based mitigation for CVE-2017-5715, also known
as Spectre V2, that protects against speculative execution branch target
injection attacks.

In this commit it is disabled by default, but will be changed in a
followup commit.

Reviewed by:	bdrewery (previous version)
MFC after:	3 days
Security:	CVE-2017-5715
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D14242
2018-02-28 14:57:45 +00:00
Kyle Evans 5af17cb319 lua-lint: Add note about luacheck in ports, silence warning
luacheck was added in ports r462609.

Silence warning about cli_execute -- it's non-standard, but for our setup it
will be a standard global.
2018-02-22 15:29:57 +00:00
Kyle Evans c8a0a7ab9b Add script for linting stand/lua to tools/boot.
We require some --globals due to custom loader extensions in our
environment. Add everything required for this to tools/boot so that other
interested parties can get up and go with linting our scripts and not get a
bunch of false-positives.
2018-02-22 04:28:52 +00:00
Warner Losh 0c5ec6c2f7 Add LOADER_DEBUG regression test 2018-02-21 23:49:18 +00:00
Eitan Adler 1983a2326b tools/80211: correct array index
wh->i_dur is a two byte value; not a single byte set twice

Reported by:	swildner@DragonFlyBSD.org
2018-02-19 19:01:46 +00:00
Hans Petter Selasky 78b52692f2 Remove obsolete tool, bus_autoconf, which is replaced by devmatch(8). 2018-02-17 14:40:28 +00:00
Kyle Evans 574a8bf981 lua-test: Image the loader test directory if it doesn't exist yet 2018-02-16 20:26:18 +00:00
Kyle Evans ff8409871e Default to /tmp/loadertest for lua test scripts 2018-02-16 20:23:48 +00:00
Warner Losh 2ec3d49ea3 Simplify building before installing. 2018-02-15 18:58:03 +00:00
Kyle Evans 29cb326c9c Build loader before installing it in lua-img.sh
Slightly more foolproof when all you're wanting to do is quickly get off the
ground with testing the lua loader.
2018-02-15 17:56:45 +00:00
Kyle Evans f86b2f4817 Set svn:executable on lua-img.sh 2018-02-15 17:47:43 +00:00
Warner Losh f52add1296 Simple script to image a small test area from a built tree. Build with
'cd stand; make MK_FORTH=no MK_LOADER_LUA=yes' then run this script.
You can then test with lua-test.sh with the same parameter.
2018-02-14 18:21:54 +00:00
Warner Losh ca72e2e288 A quick test script that we can run to use userboot's test mode to
excersize the load loader. Assumes that we already have a suitable
root area that you pass in with the first arg.
2018-02-14 17:51:51 +00:00
Warner Losh 5ec69a1509 Add lua to build script 2018-02-12 15:32:05 +00:00
Warner Losh 7cafeaa1fd Add Lua as a scripting langauge to /boot/loader
liblua glues the lua run time into the boot loader. It implements all
the runtime routines that lua expects. In addition, it has a few
standard 'C' headers that nueter various aspects of the LUA build that
are too specific to lua to be in libsa. Many refinements from the
original code to improve implementation and the number of included lua
libraries. Use int64_t for lua_Number. Have "/boot/lua" be the default
module path. Numerous cleanups from the original GSoC project,
including hacking libsa to allow lua to be built with only one change
outside luaconf.h.

Add the final bit of lua glue to bring in liblua and plug into the
multiple interpreter framework, previously committed.

Add LOADER_LUA option, currently off by default.

Presently, this is an experimental option. One must opt-in to using
this by defining WITH_LOADER_LUA and WITHOUT_FORTH. It's been
lightly tested, so keep a backup copy of your old loader handy.
The menu code, coming in the next commit, hasn't been exhaustively
tested. A LUA boot loader is 60k larger than a FORTH one, which is
80k larger than a no-interpreter one. Subtle changes in size
may tip things past some subtle limit (the binary is ~430k now
when built with LUA). A future version may offer coexistance.

Bump FreeBSD version to 1200058 to mark the milestone.

Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur,
Zakary Nafziger and Wojciech A. Koszek also contributed. Warner Losh
reworked it extensively into its current form.

Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader
Sponsored by: Google Summer of Code
Relnotes: Yes
MFC After: 1 month
Differential Review: https://reviews.freebsd.org/D14295
2018-02-12 15:31:53 +00:00
Alan Somers dc4e221c3a Convert tools/regression/sockets/socketpair to ATF
Reviewed by:	cem
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D14305
2018-02-10 19:43:52 +00:00
Ed Maste 1b49115a40 Promote llvm-cov to a standalone option
Introduce WITH_/WITHOUT_LLVM_COV to match GCC's WITH_/WITHOUT_GCOV.
It is intended to provide a superset of the interface and functionality
of gcov.

It is enabled by default when building Clang, similarly to gcov and GCC.

This change moves one file in libllvm to be compiled unconditionally.
Previously it was included only when WITH_CLANG_EXTRAS was set, but the
complexity of a new special case for (CLANG_EXTRAS | LLVM_COV) is not
worth avoiding a tiny increase in build time.

Reviewed by:	dim, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D142645
2018-02-10 00:22:35 +00:00
Kirk McKusick c97f1d3f37 Add an explanation of the block size units output by prtblknos.
Suggested by: Ravi Pokala (rpokala@)
2018-02-09 22:23:10 +00:00
Kirk McKusick 16c0c8eeec This is a little C-program that can be used to print out the list
of blocks used by a requested list of inodes.

For example, to list the blocks referenced by your kernel:

guest_12 % df /
Filesystem      1K-blocks     Used   Avail Capacity  Mounted on
/dev/gpt/rootfs  20307196 10707336 7975288    57%    /

guest_12 % ls -i /boot/kernel/kernel
160603 /boot/kernel/kernel

guest_12 % ./prtblknos /dev/gpt/rootfs 160603
160603:	lbn 0-7 blkno 3217584-3217647
	lbn 8-11 blkno 3217864-3217895 distance 216
First-level indirect, blkno 3217896-3217903 distance 0
	lbn 12-19 blkno 3217904-3217967 distance 8
	lbn 20-75 blkno 3251816-3252263 distance 33848
	lbn 76-83 blkno 3252368-3252431 distance 104
	lbn 84-91 blkno 3252464-3252527 distance 32
	lbn 92-852 blkno 3252896-3258983 distance 368

Each contiguous range of blocks is printed on a line.
The distance metric is the size of the gap from the end of the
previous set of blocks to the beginning of the next set of blocks.
Short distances are desirable.
2018-02-09 19:10:46 +00:00
Kyle Evans 312640ff19 Teach nanobsd about armv7, add -m to qemu invocations
qemu defaults to 128 MiB of RAM, which has been found to not necessarily be
enough for booting the system, at least on amd64 and armv7

Add a sensible -m 512 to the examples so that they'll work out of the box
in the general case.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D14234
2018-02-09 14:31:11 +00:00
Baptiste Daroussin a273973175 Remove gdbtui, it was already not installed on every arches
only installed on arm and sparc64.
It is the only bits that keeps us having libreadline in base
The rest of gdb can be switched to libedit and will be in another
commit
2018-02-06 11:54:20 +00:00
Marius Strobl ba8d50d08b Flesh out the creation of sparc64 UFS images. This has only been verified
to yield working images in a native build as rootgen.sh generally doesn't
support cross-testing so far.
2018-02-05 00:18:21 +00:00
Warner Losh 9a0e2e232b Fix backward conditional.
Pointed out by: david boyer
2018-02-03 21:56:38 +00:00
Eitan Adler 8d6a5512ab tools: remove note about diffburst.
Said tool was removed in 1999 in r51579
2018-01-28 05:45:20 +00:00
Dimitry Andric c79126f2e4 Merge ^/head r327624 through r327885. 2018-01-12 18:23:35 +00:00
Conrad Meyer dc045f499a Add encrypt+authenticate modes to cryptotest tool
Like jhb's cryptocheck (uncommitted so far), express encrypt+authenticate
modes as "-a <encalg>+<authalg>".

Example use with aesni(4) on AMD Zen family:

$ ./cryptotest -d aesni0 -a aes256        10000 $((128*1024))
   2.331 sec,   20000 aes256       crypts,  131072 bytes, 1124707930 byte/sec,  8580.8 Mb/sec
$ ./cryptotest -d aesni0 -a sha256        10000 $((128*1024))
   1.109 sec,   10000 sha256       crypts,  131072 bytes, 1181577161 byte/sec,  9014.7 Mb/sec
$ ./cryptotest -d aesni0 -a aes256+sha256 10000 $((128*1024))
   3.805 sec,   10000 sha256+aes256 crypts,  131072 bytes, 344460116 byte/sec,  2628.0 Mb/sec

Reported by:	jhb
Sponsored by:	Dell EMC Isilon
2018-01-10 23:19:32 +00:00
Dimitry Andric 4b49587c3d Merge ^/head r327341 through r327623. 2018-01-06 16:13:17 +00:00
Poul-Henning Kamp 5a57de683b Add a crude workaround for ports with flavors 2017-12-29 15:38:43 +00:00
Dimitry Andric 4fc74049d2 Merge ^/head r327169 through r327340. 2017-12-29 12:51:26 +00:00
Dimitry Andric fe4fed2e4d Merge llvm, clang, lld, lldb, compiler-rt and libc++ trunk r321545,
update build glue and version numbers, add new intrinsics headers, and
update OptionalObsoleteFiles.inc.
2017-12-29 00:56:15 +00:00
Eitan Adler 9914452050 other: Fix several typos and minor errors
- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by:	imp, benno
2017-12-27 03:23:58 +00:00
Dimitry Andric 54b4b13c4a Merge ^/head r326936 through r327149. 2017-12-24 13:22:57 +00:00
Dimitry Andric c9d5cb1774 Update OptionalObsoleteFiles.inc again. 2017-12-24 13:19:02 +00:00
Dimitry Andric 0c4684a8bc Update OptionalObsoleteFiles.inc for new headers and libraries under
/usr/lib/clang/6.0.0.
2017-12-24 12:46:28 +00:00
Dimitry Andric 9509d906c1 Add new llvm-objcopy utility, enabled when MK_CLANG_EXTRAS=yes. 2017-12-24 12:36:31 +00:00
Dimitry Andric 6252156da5 Vendor import of clang trunk r321414:
https://llvm.org/svn/llvm-project/cfe/trunk@321414
2017-12-24 01:00:23 +00:00
Dimitry Andric d49fee24bb Update ObsoleteFiles.inc and OptionalObsoleteFiles.inc. 2017-12-20 20:29:15 +00:00
Warner Losh 22cf6021fc Support more images (but still no geli)
Print a qemu line to a shell script to ease testing each image
Start to support multiple architectures (still very green)
Create /etc/rc that echos success and halts the system for better
automation (also include halt)
Create /etc/fstab on a per-boot type to test loader's passing root
to kernel.

This lets me run a test, connect to it with telnet and get either a
timeout, or a report of success.

Sponsored by: Netflix
2017-12-19 00:18:17 +00:00