Commit Graph

270782 Commits

Author SHA1 Message Date
Warner Losh
5c68a21697 loader:prefix is only used for LOADER_VERIEXEC
Only define and set prefix when LOADER_VERIEXEC is defined. It's only
used by the LOADER_VERIEXEC code.

Sponsored by:		Netflix
2021-12-13 12:04:53 -07:00
Kristof Provost
08851be187 ndp tests: fix cleanup
Fix the cleanup function name so we actually remove our test jail and
interfaces.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-13 18:14:59 +01:00
黃清隆
6964b77e59 sys/dev/arcmsr: Update Areca RAID driver to fix some issues on ARC-1886.
1. Doorbell interrupt status may arrive lately when doorbell interrupt on
   ARC-1886.
2. System boot up hung when ARC-1886 with no volume created or no device
   attached.

Many thanks to Areca for continuing to support FreeBSD.

MFC after:	2 weeks
2021-12-13 08:09:15 -08:00
Andrew Turner
71bf1c4cc5 Add accelerated arm64 sha512 to libmd
As with sha256 add support for accelerated sha512 support to libmd on
arm64. This depends on clang 13+ to build as this is the first release
with the needed intrinsics. Gcc should also support them, however from
a currently unknown release.

Reviewed by:	cem
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33373
2021-12-13 15:33:22 +00:00
Kristof Provost
4826406b30 pf tests: log additional information when a test ends
Log information from the running jails (routing, interfaces and pf) as
well as interfaces on the host.

This information is expected to be useful in debugging test failures.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-13 15:54:03 +01:00
Cy Schubert
8f19f3d31a ipfilter: Fix struct ifnet pointer type
The fr_info struct contains a summary of a packet. One of its fields
is a pointer to the ifnet struct the packet arrived on. It is pointed
to by a void* because ipfilter supports multiple O/Ses. Unfortunately
this makes it difficult it examine with DTrace. Defining fin_ifp as a
pointer to an ifnet struct makes the struct it points to using a DTrace
script possible.

MFC after:	1 week
2021-12-13 06:24:50 -08:00
Andriy Gapon
8b37048bc5 Revert "mmc_sim: fix setting of the mutex name"
This reverts commit df472af034.

The change hasn't been reviewed.
2021-12-13 13:51:47 +02:00
Andriy Gapon
b277ef3304 ds3231: fix accidental breakage of !FDT in 1256067c
MFC after:	10 days
2021-12-13 13:49:47 +02:00
Andriy Gapon
df472af034 mmc_sim: fix setting of the mutex name
To quote the manual:
 The pointer passed in as name and type is saved rather than the data
 it points to.  The data pointed to must remain stable until the mutex
 is destroyed.

It seems that the type is actually copied, but the name is stored as
a pointer indeed.
mmc_cam_sim_alloc used a name stored on stack.
So, a corrupt mutex name would be reported.
For example:
  lock order reversal: (sleepable after non-sleepable)
  1st 0xd7285b20 <8A><C0><C0>P@<C1><D0>P@<C1>^D^A (aw_mmc_sim, sleep mutex) @ /usr/devel/git/orange/sys/cam/cam_xpt.c:2804

This change moves the name to struct mmc_sim.
Also, that name is used as the sim name as well.
Unused mtx_name variable is removed too.
2021-12-13 13:40:47 +02:00
Andriy Gapon
1256067c5c ds3231: allow configuration via hints on FDT systems
MFC after:	10 days
2021-12-13 13:40:00 +02:00
Andriy Gapon
b416345d5b pcf8591: remove write-only variables
MFC after:	1 week
2021-12-13 13:39:08 +02:00
Andriy Gapon
cca0d3bbd8 amdsbwd: always enable watchdog register decoding
This seems to be required even if the watchdog is accessed via the common
MMIO space.

Tested on:
- Ryzen 3 3200U APU;
- Ryzen 7 5800X CPU with X570 chipset.

MFC after:	2 weeks
2021-12-13 13:36:50 +02:00
Alfonso Siciliano
1de4665dfc kbdmap: adapt to the new libbsddialog API
Differential Revision:	https://reviews.freebsd.org/D33398
2021-12-13 09:08:09 +01:00
Alfonso Siciliano
0a7e19b30f tzsetup: adapt for libbsddialog 0.0.1
libbsdialog 0.0.1 provides:
* bsddialog_conf.auto_minwidth:
* menurows is variable with autosize (properly defines max menurows)

Then tzsetup can use BSDDIALOG_AUTOSIZE keeping the dialog behavior:
min 24 cols, max 16 menurows

Differential revision:	https://reviews.freebsd.org/D33397
2021-12-13 09:07:47 +01:00
Baptiste Daroussin
8c4f402881 bsddialog: import version 0.0.1 2021-12-13 09:01:39 +01:00
Alfonso Siciliano
e41955dd2d bsddialog: import version 0.0.1 2021-12-13 08:54:07 +01:00
Konstantin Belousov
4626aa7fda Add a tool to test AVX context integrity under ctx switches and signals (amd64)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-12-13 04:31:40 +02:00
Rick Macklem
24947b701d nfscl: Fix must_commit handling for mirrored pNFS mounts
For pNFS mounts to mirrored Flexible File layout pNFS servers,
the "must_commit" component in the nfsclwritedsdorpc
structure must be checked and the "must_commit" argument passed
into nfscl_doiods() must be updated.  Technically, only writes to
the DS with a writeverf change must be redone, but since this
occurrence will be rare, the must_commit argument to nfscl_doiosd()
is set to 1, so all writes to all DSs will be redone.

This bug would affect few, since use of mirrored pNFS servers
is rare and "writeverf" rarely changes. Normally "writeverf"
only changes when a NFS server reboots.

MFC after:	2 weeks
2021-12-12 15:40:30 -08:00
Robert Wing
0b29683b32 bhyve: set EV_CLEAR for EVFILT_VNODE mevents
When an EVFILT_VNODE filter event is triggered, reset it.

This fixes the issue where a virtio-blk resize event would cause the
mevent thread to consume 100% of the cpu.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D33326
2021-12-12 12:39:40 -09:00
Dimitry Andric
da2012af42 Revert clang change that breaks CTF on aarch64
Revert commit e655e74a318e from llvm git (by Peter Collingbourne):

  AST: Create __va_list in the std namespace even in C.

  This ensures that the mangled type names match between C and C++,
  which is significant when using -fsanitize=cfi-icall. Ideally we
  wouldn't have created this namespace at all, but it's now part of
  the ABI (e.g. in mangled names), so we can't change it.

  Differential Revision: https://reviews.llvm.org/D104830

As reported by Jessica in https://reviews.llvm.org/D104830#3129527, this
upstream change is implemented in such a way that it breaks DTrace's
CTF. Since a proper fix has not yet been forthcoming, and we are
unaffected by the (CFI-related) problem upstream was trying to address,
revert the change for now.

Requested by:	jrtc27
MFC after:	3 days
2021-12-12 21:11:40 +01:00
Konstantin Belousov
73b357be92 amd64: correct size of the SSE area in the xsave layout
PR:	https://github.com/golang/go/issues/46272
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2021-12-12 20:20:31 +02:00
Konstantin Belousov
e499988f0c exec_elf: use intermediate u_long variable to correct mismatched type
vm_offset_t * vs. u_long *

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-12-12 20:07:04 +02:00
Rebecca Cran
866036f46c bhyve: Support a _VARS.fd file for bootrom
OVMF creates two separate .fd files, a _CODE.fd file containing
the UEFI code, and a _VARS.fd file containing a template of an
empty UEFI variable store.

OVMF decides to write variables to the memory range just below the
boot rom code if it detects a CFI flash device. So here we add
just the barest facsimile of CFI command handling to bootrom.c
that is needed to placate OVMF.

Submitted by: D Scott Phillips <d.scott.phillips@intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19976
MFC After: 1 week
2021-12-12 08:07:27 -07:00
Konstantin Belousov
bf83941638 imgact_elf: avoid mapsz overflow
Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33359
2021-12-12 16:28:39 +02:00
Konstantin Belousov
36df8f540f imgact_elf: check that the alignment of PT_LOAD segment is power of two
and stop recalculating alignment for PIE base, which was off by one
power of two.

Suggested and reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33359
2021-12-12 16:28:38 +02:00
Konstantin Belousov
714d6d09b5 imgact_elf: exclude invalid alignment requests
Only accept at most superpage alignment, or if the arch does not have
superpages supported, artificially limit it to PAGE_SIZE * 1024.
This is somewhat arbitrary, and e.g. could change what binaries do
we accept between native i386 vs. amd64 ia32 with superpages disabled,
but I do not believe the difference there is affecting anybody with
real (useful) binaries.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33359
2021-12-12 16:28:38 +02:00
Konstantin Belousov
a4007ae10c rnd_elf: add comment explaining the interface
Requested and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33359
2021-12-12 16:28:38 +02:00
Konstantin Belousov
9cf78c1cf6 elf image activator: convert asserts into errors
Invalid (artificial) layout of the loadable ELF segments might result in
triggering the assertion.  This means that the file should not be
executed, regardless of the kernel debug mode.  Change calling
conventions for rnd_elf{32,64} helpers to allow returning an error, and
abort activation with ENOEXEC if its invariants are broken.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33359
2021-12-12 16:28:38 +02:00
Konstantin Belousov
b4b20492cd exec_elf: assert that the image vnode is still locked on return
Suggested and reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33359
2021-12-12 16:28:38 +02:00
Konstantin Belousov
88dd7a0a39 Style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33359
2021-12-12 16:28:38 +02:00
Rick Macklem
ead50c94cb nfscl: Fix must_commit/writeverf handling for Direct I/O
Without this patch, the KASSERT(must_commit == 0,..) can be
triggered by the writeverf in the Direct I/O write reply changing.
This is not a situation that should cause a panic(). Correct
handling is to ignore the change in "writeverf" for Direct
I/O, since it is done with NFSWRITE_FILESYNC.

This patch modifies the semantics of the "must_commit"
argument slightly, allowing an initial value of 2 to indicate
that a change in "writeverf" should be ignored.
It also fixes the KASSERT()s.

This bug would affect few, since Direct I/O is not enabled
by default and "writeverf" rarely changes. Normally "writeverf"
only changes when a NFS server reboots, however I found the
bug when testing against a Linux 5.15.1 kernel nfsd, which
replied to a NFSWRITE_FILESYNC write with a "writeverf" of all
0x0 bytes.

MFC after:	2 weeks
2021-12-11 15:00:30 -08:00
Toomas Soome
6102f43cf0 loader: framebuffer should only be written into
Reading from Write Combining memory can be very-very slow. Try to use
shadow buffer to avoid such reads.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33305
2021-12-11 13:25:35 +02:00
Peter Holm
faa3605705 stress2: Remove tests from the exclude list 2021-12-11 10:45:11 +00:00
Peter Holm
a724ccf354 stress2: Disable aslr for this test to work 2021-12-11 10:43:30 +00:00
Peter Holm
8ebc232561 stress2: Save a copy of the program file for regression tests
Suggested by:	 kib
2021-12-11 06:07:04 +00:00
Cy Schubert
664882ab16 ip_log: remove set-but-not-unused vars
MFC after:	3 days
2021-12-10 21:52:54 -08:00
Cy Schubert
2169572e74 ippool: remove set-but-not-unused vars
Display of stats from a kernel core dump was never fully implemented.
Remove the dangling vars and remove the documentation.

MFC after:	3 days
2021-12-10 21:52:54 -08:00
Cy Schubert
fe5b077c9e ipfcomp: remove set-but-not-unused vars
MFC after:	3 days
2021-12-10 21:52:54 -08:00
Cy Schubert
edcdd4f644 ipfilter printfieldhdr: remove set-but-not-unused vars
MFC after:	3 days
2021-12-10 21:52:54 -08:00
Cy Schubert
9018f7fa45 ipft_tx: remove set-but-not-unused vars
MFC after:	3 days
2021-12-10 21:52:54 -08:00
Cy Schubert
712b938661 ipft_pc: remove set-but-not-unused vars
MFC after:	3 days
2021-12-10 21:52:54 -08:00
Cy Schubert
ece1946c1f ipft_hx: remove set-but-not-unused vars
MFC after:	3 days
2021-12-10 21:52:53 -08:00
Alexander Motin
81dc00331d Make msgbuf_peekbytes() not return leading zeroes.
Introduce new MSGBUF_WRAP flag, indicating that buffer has wrapped
at least once and does not keep zeroes from the last msgbuf_clear().
It allows msgbuf_peekbytes() to return only real data, not requiring
every consumer to trim the leading zeroes after doing pointless copy.
The most visible effect is that kern.msgbuf sysctl now always returns
proper zero-terminated string, not only after the first buffer wrap.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2021-12-10 23:35:53 -05:00
Eugene Grosbein
7a382e744b if_epair: fix module build outside of kernel build environment
MFC after:	3 days
2021-12-11 11:07:50 +07:00
Mateusz Piotrowski
479ea5cf2d rc.conf.5: Fix a typo 2021-12-10 23:37:40 +01:00
Mateusz Guzik
dd2f6e14ef vfs: annotate all unused MNTK_ flags 2021-12-10 20:06:28 +00:00
Mateusz Guzik
4dd23ae150 vfs: retire MNTK_NOKNOTE and VV_NOKNOTE
MNTK_NOKNOTE was introduced in 679985d03a
(dated 2005), VV_NOKNOTE in 34cc826ae8 few
months later.

Neither was ever used by anything in the tree.
2021-12-10 19:53:57 +00:00
Bora Özarslan
08055452cb libkvm: fix kvm_walk_pages
Correct bitmap operations in _kvm_bitmap_next.

Reviewed by:	jhb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D19183
2021-12-10 14:15:15 -05:00
Warner Losh
4dbc7835cd mips: Turn off LLVM MIPS targets by default
Now that MIPS isn't a recognized target for buildworld, move llvm mips
to off by default.

Sponsored by:		Netflix
Reviewed by:		dim
Differential Revision:	https://reviews.freebsd.org/D33364
2021-12-10 11:31:07 -07:00
Warner Losh
20b23ae74b stand: remove mips support
As part of decommissioning mips support, remove the boot loader
support. Do this in advance of other boot loader work to limit the
amount of work that will be thrown away.

Sponsored by:		Netflix
Reviewed by:		jrtc27
Differential Revision:	https://reviews.freebsd.org/D33377
2021-12-10 11:05:31 -07:00