Commit Graph

229970 Commits

Author SHA1 Message Date
Devin Teske
980b68eaa2 Use tabs in io.d, fix alignment issues, remove extraneous newlines 2018-02-12 23:53:38 +00:00
Jeff Roberson
e958ad4cf3 Make v_wire_count a per-cpu counter(9) counter. This eliminates a
significant source of cache line contention from vm_page_alloc().  Use
accessors and vm_page_unwire_noq() so that the mechanism can be easily
changed in the future.

Reviewed by:	markj
Discussed with:	kib, glebius
Tested by:	pho (earlier version)
Sponsored by:	Netflix, Dell/EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D14273
2018-02-12 22:53:00 +00:00
Conrad Meyer
487340b004 devmatch.8: Link to MODULE_PNP_INFO(9)
Sponsored by:	Dell EMC Isilon
2018-02-12 22:43:47 +00:00
Conrad Meyer
4777ab9764 Take a first stab at documenting use of MODULE_PNP_INFO
Sponsored by:	Dell EMC Isilon
2018-02-12 22:42:06 +00:00
Landon J. Fuller
e8a81142ab bwn(4): Fix outstanding bug in PHY-G tssi2dbm table generation caught by
-Wconstant-conversion, and remove now unnecessary warning suppression
flags.
2018-02-12 22:21:11 +00:00
Eric van Gyzen
0bbfb20fe5 Update the MTU in affected routes when IPv6 RA changes the MTU
ip6_calcmtu() only looks at the interface MTU if neither the TCP hostcache
nor the route provides an MTU.  Update the routes so they do not provide
stale MTUs.

This fixes UNH IPv6 conformance test cases v6LC_4_1_08 and v6LC_4_1_09,
which use a RA to reduce the link MTU from 1500 to 1280.

Reported and tested by:	Farrell Woods <Farrell_Woods@Dell.com>
Reviewed by:	dab, melifaro
Discussed with:	ae
MFC after:	1 week
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D14257
2018-02-12 19:49:20 +00:00
Landon J. Fuller
7c7c726bca siba(4): Ignore disabled per-core address match entries.
Previously, the address regions described by disabled admatch entries would
be treated as being mapped to the given core; while incorrect, this was
essentially harmless given that the entries describe unused address space
on the few affected devices.

We now perform parsing of per-core admatch registers and interrupt flags in
siba_erom, correctly skip any disabled admatch entries, and use the
siba_erom API in siba_add_children() to perform enumeration of attached
cores.
2018-02-12 19:36:26 +00:00
Alan Somers
21b8a7a6ca Fix a comment. No functional change.
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
2018-02-12 17:42:28 +00:00
Ian Lepore
bd54c5acba Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot
read or write of all registered realtime clocks.  In the read case, the
values read are simply discarded.  For writes, there's no alternative but
to actually write the current system time to the device.
2018-02-12 17:41:11 +00:00
Ian Lepore
45eee6db6f Add a set of convenience routines for RTC drivers to use for debug output,
and a debug.clock_show_io sysctl to control debugging output.
2018-02-12 17:33:14 +00:00
Jonathan T. Looney
48fca66157 Mark the pages used for the initial page-table entries as wired. This
makes them consistent with the way other page-table pages are allocated.
It also provides the rest of the VM system a good clue that these pages
are used.

Reviewed by:	alc, kib, markj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D14269
2018-02-12 17:27:50 +00:00
Ian Lepore
aedc51f11a Replace the existing print_ct() private debugging function with a set of
three public functions to format and print the three major data structures
used by realtime clock drivers (clocktime, bcd_clocktime, and timespec).
2018-02-12 16:25:56 +00:00
Warner Losh
5ec69a1509 Add lua to build script 2018-02-12 15:32:05 +00:00
Warner Losh
088b4f5f32 Add the lua scripts from the lua-bootloader SoC
These are the .lua files from from Pedro Souza's 2014 Summer of Code
project. Rui Paulo, Pedro Arthur and Wojciech A. Koszek also
contributed.

Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader
Sponsored by: Google Summer of Code

Improve the SoC lua menu code to bring it in line with forth
menu functionality

Submitted by: Zakary Nafziger
Sponsored by: FreeBSD Foundation

Use loader.setenv and loader.unsetenv instead of loader.perform

Convert from include("/boot/foo.lua") to foo = require("foo");
to bring in line with latest lua module conventions.

Enforce a uniform style for the new .lua files:
	o hard tab indenation for 8 spaces
	o don't have if foo then bar; else bas; end on one line

MFC After: 1 month
Relnotes: yes
Differential Review: https://reviews.freebsd.org/D14295
2018-02-12 15:32:00 +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
Warner Losh
62bca77843 Move __va_list and related defines to sys/sys/_types.h
__va_list and related defines are identical in all the
ARCH/include/_types.h files. Move them to sys/sys/_types.h

Sponsored by: Netflix
2018-02-12 14:48:20 +00:00
Warner Losh
982e7bdafc We don't support gcc < 4.2.1, so varargs.h now is just #error
always. Unifdef for versions prior to 4.2.1 and remove now-unused
header files.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D14323
2018-02-12 14:48:14 +00:00
Warner Losh
33e959abab Use standard pattern for stdargs.h
We don't support older compilers. Most of the code in these files is
for pre-3.0 gcc, which is at least 15 years obsolete. Move to using
phk's sys/_stdargs.h for all these platforms.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D14323
2018-02-12 14:48:05 +00:00
Tycho Nightingale
58a6aaf7ec Provide further mitigation against CVE-2017-5715 by flushing the
return stack buffer (RSB) upon returning from the guest.

This was inspired by this linux commit:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/kvm?id=117cc7a908c83697b0b737d15ae1eb5943afe35b

Reviewed by:	grehan
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D14272
2018-02-12 14:45:27 +00:00
Warner Losh
590682b6e6 Move devmatch to sbin from usr/sbin.
Since we want to use devmatch in context before a split /,/usr system
has mounted /usr, move devmatch to /sbin.

Sponsored by: Netflix
2018-02-12 14:44:21 +00:00
Warner Losh
ff99e28210 Fix typo 2018-02-12 06:52:49 +00:00
Warner Losh
8d99f31cbb Turn devmatch on by default.
Turn devmatch on by default. However, use 'start' instead of
'onestart' in the devmatch.conf file so the setting of
'devmatch_enable' is honored. Give an example of what to put in
devd.conf if you want to disable just the run-time part of devmatch.

Relnotes: yes
2018-02-12 06:51:20 +00:00
Warner Losh
ac28ac4863 Add usb.conf to ObsoleteFiles.
Add a note to UPDATING.
Fix a missing tab.

Relnotes: Yes
2018-02-12 06:42:38 +00:00
Warner Losh
4f28883dcd Install devmatch.conf, don't install usb.conf 2018-02-12 04:54:51 +00:00
Warner Losh
4d6e935eb2 Install devmatch int /etc/rc.d and echo modules being installed. 2018-02-12 04:52:25 +00:00
Warner Losh
4420d8e198 Switch to using devmatch to autoload drivers. Remove usb.conf
as obsolete because devmatch gets its information from the same
place as the genration scripts.
2018-02-12 04:45:26 +00:00
Warner Losh
c0c6f4d2e0 Add devmatch rc.d integration
Create simple script to load modules on demand based on the device
identifying information.

Sponsored by: Netflix
2018-02-12 04:45:17 +00:00
Conrad Meyer
4bc191c3dc device_add_child.9: reference logical opposite, device_delete_child(9) 2018-02-11 22:09:07 +00:00
Scott Long
63b1a33514 Print out the shared memory queues during initialization
Sponsored by:	Netflix
2018-02-11 20:15:47 +00:00
Brooks Davis
ad704a34bc Use syscall_helper_register(9) rather than syscall_register().
The usage is simpler, documented, and more common.

Reviewed by:	cem
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14227
2018-02-11 18:37:08 +00:00
Warner Losh
38c35fec7a Consistent macro indentation is the hobgoblin of small minds
Line up the macro definitions and names here like the machine/stdarg.h
files that this replaced. This is easier to read and also makes it
easier to match up with other includes. Also two space indent va_end
to match the rest of the surrounding if block.
2018-02-11 17:45:38 +00:00
Ian Lepore
5eebd6c02b Regenerate devd/usb.conf after the recent addition of several new device IDs. 2018-02-11 16:35:56 +00:00
Ian Lepore
4a8b6f54d1 Add a device ID to uftdi for TIAO USB Multi Protocol Adapter (TUMPA).
PR:		225810
2018-02-11 16:35:23 +00:00
Mark Felder
82004aa8e1 Add Thomas Zander to ports-secteam 2018-02-11 16:12:55 +00:00
Edward Tomasz Napierala
11db7fa42b Make lock(1) use PAM. This makes the -p option work again. (Well, kind of,
because the whole idea of this utility is rather broken.)

This originally come from NetBSD, and was later reworked a bit.

Reviewed by:	des@ (earlier version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D4981
2018-02-11 13:35:31 +00:00
Conrad Meyer
b42712a8b7 Add GUID and alias for Apple APFS partition
PR:		225813
Submitted by:	James Wright <james.wright AT jigsawdezign.com>
2018-02-11 06:57:20 +00:00
Devin Teske
e6c0055599 Fix typo in dtrace_tcp(4)
Using args[2]->tcps_state as-documented results in error:
operator -> cannot be applied to pointer to type "void"

This error is accurate as the synopsis for tcp:::state-change is:
tcp:::state-change(void *, csinfo_t *, void *, tcpsinfo_t *, void *,
    tcplsinfo_t *);

args[2] refers to the third argument which is always NULL (as-
documented). The to-state for the TCP connection state transition is
actually in the fourth argument, args[3]->tcps_state.
2018-02-11 03:02:29 +00:00
Conrad Meyer
4b69e622d5 Document syscall_helper_register(9), syscall_helper_unregister(9) 2018-02-10 20:34:09 +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
Conrad Meyer
e9180d6956 socketpair.2: Reference relevant POSIX standards
Sponsored by:	Dell EMC Isilon
2018-02-10 19:41:32 +00:00
Justin Hibbits
e4803b1c14 Fix uninitialized warning, and work around a bug in gcc over clobbering
Summary:
r329077 caused gcc to emit uninitialized use warnings.  Attempting to
fix those warnings yielded the following warnings:

usr.bin/tftp/main.c: In function 'main':
usr.bin/tftp/main.c:181: warning: variable 'el' might be clobbered by
'longjmp' or 'vfork'
usr.bin/tftp/main.c:182: warning: variable 'hist' might be clobbered by
'longjmp' or 'vfork'

This is a known bug in gcc, found at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239

Work around that by simply marking hist and el as static.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D14302
2018-02-10 17:17:15 +00:00
Eugene Grosbein
6cd3353ba3 ppp(8): fix code producing debugging logs
Fix several cases when long buffer is copied to shorter one
using snprintf that results in contents truncation and
clobbering unsaved errno value and creation of misleading logs.

PR:		218517
Approved by:	avg (mentor)
MFC after:	1 month
2018-02-10 17:09:51 +00:00
Emmanuel Vadot
dc9b494e2b dts: Update our device tree sources files from Linux 4.15 2018-02-10 15:29:46 +00:00
Pedro F. Giffuni
0ed20b78b7 libcompat: Use %hu for unsigned shorts.
Obtained from:	DragonFlyBSD (git  82e1476a)
2018-02-10 14:45:29 +00:00
Andrey V. Elsukov
b2fe54bc8b Reinitialize IP header length after checksum calculation. It is used
later by TCP-MD5 code.

This fixes the problem with broken TCP-MD5 over IPv4 when NIC has
disabled TCP checksum offloading.

PR:		223835
MFC after:	1 week
2018-02-10 10:13:17 +00:00
Brooks Davis
946c028ec1 Use syscall_helper_register() to register syscalls and initialize though
the module interface.

This is the more common approach and the syscall_helper interface is
easier to understand.

Reviewed by:	jhb
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14251
2018-02-10 01:09:22 +00:00
Alexander Motin
4f5d657343 Teach mps(4) and mpr(4) drivers to autotune chain frames.
This is a first part of the change.  It makes the drivers to calculate
the required number of chain frames to satisfy worst case scenarios, but
it does not change existing overly strict limits on them.  The next step
will be to rewrite the allocator to not require megabytes of physically
contiguous address space, that may be problematic if done after boot,
after doing which the limits can be removed.  Until that this code can
just correct user set limits, if they are set too high.

Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14261
2018-02-10 00:55:46 +00:00
Ed Maste
5b9c365429 Regen src.conf.5 after r329093, WITH_/WITHOUT_LLVM_COV 2018-02-10 00:27:29 +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
Brooks Davis
e3e9432478 Add a deprecation warning when using the feature which mounts devices
to see how much space it on them.

Adjust MOUNT_CHAR_DEVS to allow the free space of already mounted
devices to be displayed and report an appropriate error if the
device isn't mounted.

Reviewed by:	cem
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D8801
2018-02-10 00:22:25 +00:00