Commit Graph

268240 Commits

Author SHA1 Message Date
Peter Holm
c86a43f1c7 stress2: Added a syzkaller reproducer 2021-09-06 13:32:23 +00:00
Alex Richardson
24f586182f Enable MK_LLVM_BINUTILS if MK_ASAN is requested
ASan will not be able to provide backtraces with symbol names with
elftoolchain's addr2line. To fix this turn MK_LLVM_BINUTILS on by
default when ASan instrumentation is requested.

Reviewed By:	emaste, markj
Differential Revision: https://reviews.freebsd.org/D31061
2021-09-06 10:24:34 +01:00
Alex Richardson
021385aba5 Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain
When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as
ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones.
Having the LLVM binutils instead of the elftoolchain ones allows us to use
features such as LTO that depend on binutils that understand LLVM IR.
Another benefit will be an improved user-experience when compiling with
AddressSanitizer, since ASAN does not symbolize backtraces correctly if
addr2line is elftoolchain addr2line instead of llvm-symbolizer.
See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html
for more details.

This is currently off by default but will be turned on by default at some
point in the near future.

Reviewed By:	emaste

Differential Revision: https://reviews.freebsd.org/D31060
2021-09-06 09:49:49 +01:00
Alex Richardson
8e1c989abb Don't build and install {llvm,clang,lldb}-tblgen for the target
The tablegen binaries are only needed to build software that uses
LLVM's infrastructure for command line options,
disassembler tables, etc. They are not user-facing binaries and
should therefore not be installed by default.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D31058
2021-09-06 09:32:41 +01:00
Alex Richardson
e7e22476d1 Don't default MK_LLVM_TARGET_ALL to yes unless MK_CLANG is requested
When building -DWITH_LLVM_BINUTILS -DWITHOUT_CLANG, this avoids
building a few hundred C++ source files that should not be needed
by default.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D31059
2021-09-06 09:31:25 +01:00
Colin Percival
bd11e253a9 Add _sleep to TSLOG
Most of the nvme initialization time in my tests is being spent here
(via pause_sbt).
2021-09-05 12:50:15 -07:00
Colin Percival
bad42df9bf Add some nvme initialization routines to TSLOG
About 335 ms of EC2 instance boot time is being spent here.
2021-09-05 12:48:43 -07:00
Colin Percival
7347dfce01 Add run_interrupt_driven_config_hooks to TSLOG
The 'intr_config_hooks' SYSINIT is now taking a nontrivial amount of
time in my profiling; run_interrupt_driven_config_hooks is responsible
for most of it, so this adds useful information to the resulting
flamecharts.
2021-09-05 12:45:29 -07:00
Mateusz Guzik
007724cbca hpen(4): removed leftover hpen_final_digi_cb declaration 2021-09-05 17:31:34 +00:00
Peter Holm
bb61ccd530 stress2: Added missing ktrace() cleanup 2021-09-05 09:01:20 +02:00
Alexander Motin
1f7a6325fe sound(4): Remove pointless Giant from bus_dma_tag_create().
None of the drivers really implement asynchronous buffer loading, so
they don't need lock there.  The only question is which of them have
BUS_DMA_NOWAIT flag there already, and to which it should be added.
2021-09-04 18:30:36 -04:00
Robert Wing
440320b620 ffs: remove unused thread argument from ffs_reload()
MFC After:      1 week
Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D31127
2021-09-04 12:25:10 -08:00
Alexander Motin
541699f6f6 Remove impossible checks. 2021-09-04 16:10:50 -04:00
Alexander Motin
71bf3900b7 ioat(4): Remove Giant from ioat_test enable/disable.
MFC after:	1 month
2021-09-04 15:54:17 -04:00
Kristof Provost
312f5f8a4f altq: mark callouts as mpsafe
There's no reason to acquire the Giant lock while executing the ALTQ
callouts.

While here also remove a few backwards compatibility defines for long
obsolete FreeBSD versions.

Reviewed by:	mav
Suggested by:	mav
Differential Revision:	https://reviews.freebsd.org/D31835
2021-09-04 17:26:10 +02:00
Justin Hibbits
7b81e6c7ca Support bootstrapping from Linux/ppc* 2021-09-04 11:47:30 -05:00
Justin Hibbits
eb937f67f8 powerpc: Fix typo in thread register copy
Should be saving off td0's register's, not td's.
2021-09-04 11:44:02 -05:00
Brandon Bergren
35a1aa5f9c [PowerPC] Fix outdated FP regs on fork(2) and friends
Summary:
Failure to update the FP / vector state was causing daemon(3) to violate C ABI by failing to preserve nonvolatile registers.

This was causing a weird issue where moused was not working on PowerBook G4s when daemonizing, but was working fine when running it foreground.

Force saving off the same state that cpu_switch() does in cases where we are about to copy a thread.

MFC after: 1 week
Sponsored by: Tag1 Consulting, Inc.

Test Plan:
```
/*
 * Test for ABI violation due to side effects of daemon(3).
 *
 * NOTE: Compile with -O2 to see the effect.
 */
/* Allow compiling for Linux too. */

static double test = 1234.56f;

/*
 * This contrivance coerces clang to not bounce the double
 * off of memory again in main.
 */
void __attribute__((noinline))
print_double(int j1, int j2, double d)
{
	printf("%f\n", d);
}

int
main(int argc, char *argv[])
{
	print_double(0, 0, test);

	if (daemon(0, 1)) {
	}
	/* Compiler assumes nonvolatile regs are intact... */
	print_double(0, 0, test);
	return(0);
}
```

Working output:
```
1234.560059
1234.560059
```

Output in broken case:
```
1234.560059
0.0
```

Reviewers: #powerpc

Subscribers: jhibbits, luporl, alfredo

Tags: #powerpc

Differential Revision: https://reviews.freebsd.org/D29851
2021-09-04 11:33:03 -05:00
Ed Maste
b0025f9b7f openssh: update default version addendum in man pages
Fixes:		2f513db72b ("Upgrade to OpenSSH 7.9p1.")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2021-09-04 11:33:13 -04:00
Kristof Provost
846a6e8f9a pfctl: print counters in decimal
795d78a467 pfctl: Don't use PRIu64 mistakenly changed these to be
printed as hexadecimal numbers.

Reported by:	Florian Smeets
MFC after:	4 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-09-04 16:07:59 +02:00
Gordon Bergling
88a3af4da1 crypto(4): Fix a few typos in camellia.c
- s/valiables/variables/

Obtained from:	NetBSD
MFC after:	3 days
2021-09-04 13:02:11 +02:00
Gordon Bergling
631504fb34 Fix a common typo in source code comments
- s/existant/existent/

MFC after:	3 days
2021-09-04 12:56:57 +02:00
Bjoern A. Zeeb
cb5c07649a net80211: add func/line information to IEEE80211_DISCARD* macros
While debugging is very good in net80211, some log messages are
repeated in multiple places 1:1.  In order to distinguish where the
discard happened and to speed up analysis, add __func__:__LINE__
information to all these messages.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-09-04 09:24:51 +00:00
Bjoern A. Zeeb
49c220b021 net80211: comments and whitespace
Add a missing '.', fix spelling of "failed" and unwrap a closing );
No functional changes.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2021-09-04 09:16:25 +00:00
Kyle Evans
76461921da caroot: update root store
- Four (4) added
- Two (2) removed
2021-09-04 02:32:20 -05:00
Alexander Motin
a264594d4f Unify console output.
Without this change when virtual console enabled depending on buffer
presence and state different parts of output go to different consoles.

MFC after:	1 month
2021-09-03 23:13:42 -04:00
Alexander Motin
bd6085c6ae Re-implement virtual console (constty).
Protect conscallout with tty lock instead of Giant.  In addition to
Giant removal it also closes race on console unset.

Introduce additional lock to protect against concurrent console sets.

Remove consbuf free on console unset as unsafe, making impossible to
change buffer size after first allocation.  Instead increase default
buffer size from 8KB to 64KB and processing rate from 5Hz to 10-15Hz
to make the output more smooth.

MFC after:	1 month
2021-09-03 22:18:51 -04:00
Alexander Motin
cd85b97e0e rt(4): Replace Giant callout+task with timeout_task. 2021-09-03 18:10:06 -04:00
Ed Maste
ba91e31f47 openssh: remove login class restrictions leftovers
MFC after:	2 weeks
Fixes:		27ceebbc24 ("openssh: simplify login class...")
Sponsored by:	The FreeBSD Foundation
2021-09-03 16:07:47 -04:00
Ed Maste
258f5f79bb openssh: restore local change to gssapi include logic
/usr/include/gssapi.h claims that it is deprecated, and gssapi/gssapi.h
should be used instead.  So, test HAVE_GSSAPI_GSSAPI_H first falling
back to HAVE_GSSAPI_H.

This will be submitted upstream.

Fixes:		6eac665c81 ("openssh: diff reduction against...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31810
2021-09-03 16:07:47 -04:00
Alexander Motin
da69c67526 vt(4): Mark callouts MP-safe.
The code explicitly takes Giant when it accesses keyboard, and I see
no reason to take it globally by callout(9).

MFC after:	1 month
2021-09-03 15:42:46 -04:00
Alexander Motin
fa3b03d378 pcib(4): Switch from callout to timeout_task.
This allows to avoid blocking on Giant in callout context, moving to
already existing dedicated taskqueue_pci_hp thread.

MFC after:	1 month
2021-09-03 15:03:44 -04:00
Brooks Davis
e51b29b5a9 mprotect.2: Remove legacy BSD text
This text dates to the BSD 4.4 import and is misleading.  The mprotect
syscall acts on page granularity and breaks up mappings as required to
do so.

Note that with the addition of non-transparent superpages (aka
largepages) the size of a page at a given address may vary.  This
commit does not attempt to address the lack of documentation of this
feature.

Sponsored by:	DARPA

Reviewed by:	alc, mckusick, imp, kib, markj
Differential Revision:	https://reviews.freebsd.org/D31776
2021-09-03 19:30:23 +01:00
Alexander Motin
9895a2073f bnxt(4): Mark sysctls MP-safe.
MFC after:	1 month
2021-09-03 13:51:08 -04:00
Alexander Motin
4081c895e5 bxe(4): Mark sysctls and callout MP-safe.
MFC after:	1 month
2021-09-03 12:25:32 -04:00
Alexander Motin
6b2ff27cb9 mge(4): Mark sysctls and callout MP-safe.
MFC after:	1 month
2021-09-03 12:15:39 -04:00
Alfredo Dal'Ava Junior
f21fcae487 llvm: Revert "[HardwareLoops] Change order of SCEV expression construction for InitLoopCount."
Reverts llvm commit 42eaf4fe0adef3344adfd9fbccd49f325cb549ef, pointed
from bisect as source of regression that causes liblzma to compress/
uncompress incorrectly. It's know to affect powerpc64 BE only.

The patch unbreaks FreeBSD powerpc64 installation media, since
bsdinstall can't uncompress the *.txz produced by FreeBSD CI. It's
probably miscompiling other software bas well.

Upstream PR: https://bugs.llvm.org/show_bug.cgi?id=51714

Reviewed by:	dim
MFC after:	2 days
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D31804
2021-09-03 13:31:54 -03:00
Cy Schubert
bd452dcbed wpa: Enable RSN Preauthentication
RSN Preauthentication allows a station autnetnicate to an AP that
it is not associated with yet while associated with a different AP.
This allows athentication to multiple APs simulteneously.

Tested by:	philip
MFC after:	2 months
2021-09-03 06:14:59 -07:00
Cy Schubert
3968b47cd9 wpa: Enable MBO
Enable WiFi 6 MBO (Multi Band Operation). MBO is a prereq to 802.11ax.

MBO allows the efficient use of multiple frequency bands (channels).

To facilitate MBO, WNM (Wireless Network Monitoring) is a prerequisite.
It is required to build.

Tested by:	philip
MFC after:	2 months
2021-09-03 06:14:01 -07:00
Cy Schubert
c1d255d3ff wpa: Import wpa_supplicant/hostapd commits up to b4f7506ff
Merge vendor commits 40c7ff83e7,
efec822389, and
2f6c3ea960.

Tested by:	philip
MFC after:	2 months
2021-09-03 06:08:41 -07:00
Kristof Provost
a0c64a443e pf: ensure states passed to pf_free_state() are always unlinked
In pf_create_state() we can end up deleting the state immediately. This
can happen if we fail to map the relevant addresses or fail
normalization or fail to insert it into the state table.
If that happens we delete the state again with pf_free_state(). However,
this asserts that the state must be unlinked.

It's correct to simply set the state to PFTM_UNLINKED because we've not
yet linked it.

Submitted by:	Mateusz Guzik <mjg@FreeBSD.org>
Reviewed by:	scottl
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31752
2021-09-03 09:36:19 +02:00
Philip Paeps
71611b0c68 tcp: document TCP Fast Open (RFC 7413) in tcp(4)
Adds documentation for the TCP_FASTOPEN socket option
and related MIB variables to the tcp(4) manual page.

PR:		257907
Reviewed by:	gbe
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D31764
2021-09-03 10:33:12 +08:00
Alexander Motin
5d9e5a7edf Missed line from 7af4475a6e.
MFC after:	2 weeks
2021-09-02 22:25:16 -04:00
Alexander Motin
4730a8972b callout(9): Allow spin locks use with callout_init_mtx().
Implement lock_spin()/unlock_spin() lock class methods, moving the
assertion to _sleep() instead.  Change assertions in callout(9) to
allow spin locks for both regular and C_DIRECT_EXEC cases. In case of
C_DIRECT_EXEC callouts spin locks are the only locks allowed actually.

As the first use case allow taskqueue_enqueue_timeout() use on fast
task queues.  It actually becomes more efficient due to avoided extra
context switches in callout(9) thanks to C_DIRECT_EXEC.

MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D31778
2021-09-02 21:16:46 -04:00
Alexander Motin
7af4475a6e vmd(4): Major driver refactoring
- Re-implement pcib interface to use standard pci bus driver on top of
vmd(4) instead of custom one.
 - Re-implement memory/bus resource allocation to properly handle even
complicated configurations.
 - Re-implement interrupt handling to evenly distribute children's MSI/
MSI-X interrupts between available vmd(4) MSI-X vectors and setup them
to be handled by standard OS mechanisms with minimal overhead, except
sharing when unavoidable.

Successfully tested on Dell XPS 13 laptop with Core i7-1185G7 CPU (VMD
device ID 0x9a0b) and single NVMe SSD, dual-booting with Windows 10.

Successfully tested on Supermicro X11DPI-NT motherboard with Xeon(R)
Gold 6242R CPUs (VMD device ID 0x201d), simultaneously handling NVMe
SSD on one PCIe port and PLX bridge with 3 NVMe and 1 AHCI SSDs on
another.  Handles SSD hot-plug (except Optane 905p for some reason,
which are not detected until manual bus rescan) and enabled IOMMU
(directly connected SSDs work, but ones connected to the PLX fail
without errors from IOMMU).

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
Differential revision:	https://reviews.freebsd.org/D31762
2021-09-02 20:58:02 -04:00
Alexander Motin
8c14d7da5b bnxt(4): Fix bugs in WOL support.
Before this change driver reported IFCAP_WOL_MAGIC enabled, but not
supported.  It caused errors on some SIOCSIFCAP calls.  Instead
report the support if hardware supports WOL, and enabled status if
it has such filter installed on boot.

Also bnxt_wol_config() should check WOL status in if_getcapenable(),
not in if_getcapabilities() to get current one.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2021-09-02 18:23:05 -04:00
Toomas Soome
4c7a3a70e0 loader.efi: fix console output after BS off
When Boot Services (BS) are switched off, we can not use BS
functions any more. Since drawn console does implement our own
Blt(), we can use it to draw the console.

However, SimpleTextOutput protocol based console output must be
blocked.

Tested by inserting printf() after ExitBootServices() call.

MFC after:	1 week
2021-09-03 00:48:56 +03:00
Alan Somers
cc2d08d388 ses: Guard the elm_type_names declaration by _KERNEL
MFC after:	2 weeks
Sponsored by:	Axcient
2021-09-02 14:47:18 -06:00
Alan Somers
1fb52e4373 ses: Correct spelling of "Temperature Sensor"
According to SES 4 revision 2 table 71, it should be singular.

MFC after:	2 weeks
Sponsored by:	Axcient
2021-09-02 14:38:06 -06:00
Vladimir Kondratyev
9d04336b61 hmt(4): Add support for touchpads with no "button type" or
"maximum number of contacts" usages.

Assume touchpad to be a clickpad if it has only internal button.
Set number of contacts to 5 for touchpads and to 10 for touchscreens.
Check for fetched report length to avoid reading of stalled data.
Fixes Dell Precision 7550 laptop.

Tested by:	Shawn Webb <shawn.webb_AT_hardenedbsd_DOT_org>
PR:		257992
MFC after:	2 week
2021-09-02 22:35:27 +03:00