Commit graph

270924 commits

Author SHA1 Message Date
John Baldwin
fd01963cc3 usr.bin/dtc: Include <limits> for std::numeric_limits<>.
This is needed when building natively as a cross-tool on hosts such as
Linux using more recent versions of libstdc++.

Co-authored-by:	Alexander Richardson <arichardson@FreeBSD.org>
Obtained from:	CheriBSD

(cherry picked from commit 1c44d2bf86)
2022-07-13 11:45:51 -07:00
John Baldwin
643b3b382d .github: Add a build on Ubuntu 22.04 using llvm 14.
Reviewed by:	uqs
Pull Request:	https://github.com/freebsd/freebsd-src/pull/599

(cherry picked from commit 74536fca79)
2022-07-13 11:44:26 -07:00
John Baldwin
0d53db064e .github: Cross-build aarch64 as well as amd64 kernels.
This required adding an explicit os list to the matrix.

Reviewed by:	uqs
Pull Request:	https://github.com/freebsd/freebsd-src/pull/599

(cherry picked from commit 3491ed652e)
2022-07-13 11:44:26 -07:00
John Baldwin
f85c2be7d5 .github: Update compilers used for cross-build testing.
- Drop clang 9 build, and switch the remaining ubuntu build to
  the more modern clang 12.

- Update the label for the macos-latest builds which are now using
  clang 13 rather than clang 12.

Reviewed by:	uqs
Pull Request:	https://github.com/freebsd/freebsd-src/pull/599

(cherry picked from commit 49335eda0f)
2022-07-13 11:44:26 -07:00
Ulrich Spörlein
68cbaf755c Make it clear we're running clang-12 for the GH actions
This chases a homebrew change in the default clang version.

Reviewed by:	arichardson
Differential Revision: https://reviews.freebsd.org/D31231

(cherry picked from commit 2f677dcedf)
2022-07-13 11:44:26 -07:00
Glen Barber
c7bb57f17f release: increase IMAGE_SIZE for arm, arm64, riscv
Related to: 	PR 264032
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 1dfcff294e)
2022-07-13 14:37:57 -04:00
John Baldwin
8660d530f7 etcupdate: Preserve permissions when installing a resolved file.
Similar to the change in 1a04446f08, use
cat to overwrite the contents of the existing file rather than cp so
that metadata of the existing file such as permissions and ownership
is preserved.

PR:		255514
Reported by:	uqs

(cherry picked from commit f8287caae4)
2022-07-13 11:00:50 -07:00
John Baldwin
5d7b7a98e5 etcupdate: Don't rotate trees for a dry run.
When performing a dry run, remove the temporary tree created rather
than rotating the trees.  Rotating the trees meant that etcupdate
thought the latest changes were already merged and would not merge
them on the next real run.

PR:		260281
Reported by:	Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
Fixes:		0611aec3cf etcupdate: Always extract to a temporary tree.

(cherry picked from commit 431944fb5f)
2022-07-13 11:00:45 -07:00
John Baldwin
b53f356918 crypto: Fix assertions for digest-only sessions with separate output.
Digest-only sessions do not generate modified payload as an output, so
don't bother asserting anything about the payload with respect to the
output buffer other than the payload output start being zero.

In addition, a verify request on a digest-only session doesn't
generate any output at all so should never have a separate output
buffer.

PR:		252316
Reviewed by:	markj
Co-authored-by:	Jeremy Faulkner <gldisater@gmail.com>
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35578

(cherry picked from commit c71f2370c5)
2022-07-13 09:25:14 -07:00
John Baldwin
6ab064ac06 gcore: Use PT_GETREGSET for NT_THRMISC and NT_PTLWPINFO.
This avoids the need for dealing with converting lwpinfo for alternate
ABIs in gcore itself.

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35667

(cherry picked from commit d95657a1a7)
2022-07-13 09:25:02 -07:00
John Baldwin
89d070d03c Add register sets for NT_THRMISC and NT_PTLWPINFO.
For the kernel this is mostly a non-functional change.  However, this
will be useful for simplifying gcore(1).

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35666

(cherry picked from commit 0288d4277f)
2022-07-13 09:24:54 -07:00
John Baldwin
71b19e1b9c gcore: Remove unused typedefs.
These are no longer needed after commit 4965ac059d which used
PT_GETREGSET to fetch NT_PRSTATUS and NT_FPREGSET.

Reviewed by:	markj, emaste
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35665

(cherry picked from commit d2a3c30a51)
2022-07-13 09:22:19 -07:00
John Baldwin
2ca500f196 x86 mptable: Include <x86/legacvar.h> for legacy_get_pcibus().
Fixes:		b076d8d54c mptable_hostb: Use legacy_get_pcibus() to fetch PCI bus number.

(cherry picked from commit 15a6642da6)
2022-07-13 09:21:27 -07:00
John Baldwin
516846b256 mptable_hostb: Use legacy_get_pcibus() to fetch PCI bus number.
The mptable_hostb driver is a child of legacy0 and has legacy bus
ivars, not PCI or PCI bridge ivars.

PR:		264819
Reported by:	Dennis Clarke <dclarke@blastwave.org>
Diagnosed by:	avg
Reviewed by:	avg
Differential Revision:	https://reviews.freebsd.org/D35548

(cherry picked from commit b076d8d54c)
2022-07-13 09:21:10 -07:00
John Baldwin
041857e57b pmcannotate: Don't increment end address passed to objdump -d.
libpmc already returns an end address that is after the end of the
last instruction of a function (on both amd64 and arm64) as the end
address written to the annotate map file is computed as the start
address of the symbol plus the size.

Adding one could result in a curious failure where an entire
function's contents in assembly was reduced instead to only the first
instruction.  The reason is that when the end instruction is bumped by
one, objdump -d can append the first instruction of the next function
in its output.  However, since pmcannotate concatenates all of the
objdump -d output from various functions into a single file which it
then searches to find the assembly for a given file, if this
additional trailer was earlier in the file than the full function, the
trailer was chosen to represent the entire function resulting in the
truncated listing of the function.

Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D35399

(cherry picked from commit 73702c3980)
2022-07-13 09:20:45 -07:00
John Baldwin
74a790b760 newvers.sh: Don't use return to exit.
Commit acfb506b3d replaced an exit 0 when using -V with a return
instead.  FreeBSD's sh treats a return outside of a function like
exit, but this is a non-portable extension.  Other Bourne shells only
permit return to be used within a function and continue execution
(possibly with a warning).

To fix, don't reuse VARS_ONLY (which is intended to be set by other
scripts before sourcing newvers.sh directly) and instead use a new
variable (VARS_ONLY_EXIT) to restore the use of exit for the
non-sourced case.

Reviewed by:	emaste
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35481

(cherry picked from commit 6ab35c78fb)
2022-07-13 09:20:34 -07:00
John Baldwin
b45594b271 firmware: Map '@' in filenames to '_' in symbols.
'@' is not a valid character in symbol names and can sometimes appear
in path names.

Reviewed by:	imp, markj
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35480

(cherry picked from commit 628a4156a7)
2022-07-13 09:19:51 -07:00
John Baldwin
498f1c8ed2 rc.d/ntpd: Restart ntpd when resuming from sleep.
ntpd does not always gracefully handle clock steps during resume.
This is probably most useful in conjunction with
ntpd_sync_on_start=YES which will work around any clock skew while
suspended.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D35479

(cherry picked from commit 1442fed7e2)
2022-07-13 09:19:45 -07:00
John Baldwin
50959e8840 ktls_test: Permit an option to skip tests not using ifnet TLS.
If ktls.require_ifnet is set to true, then check the TLS offload mode
for tests sending and receiving records and skip the test if the
offload mode is not ifnet mode.

This can be used along with ktls.host to run KTLS tests against a NIC
supporting ifnet TLS and verify that expected cipher suites and
directions used ifnet TLS rather than software TLS.  Receive tests may
result in a false positive as receive ifnet TLS can use software as a
fallback.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D35427

(cherry picked from commit ea4ebdcb4d)
2022-07-13 09:19:39 -07:00
John Baldwin
3736087e58 ktls_test: Permit connecting to a remote echo server for tests.
Previously ktls tests always executed over a local socket pair.
ktls.host can be set to a host to connect to with a single socket
instead.  The remote end is expected to echo back any data received
(such as the echo service).  The port can be set with ktls.port which
defaults to "echo".

This is primarily useful to permit testing NIC TLS offload use cases
where the traffic needs to transit the NIC.

Note that the variables must be set via
'kyua -v test_suites.FreeBSD.ktls.host=host'.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D35426

(cherry picked from commit 2400a7b18f)
2022-07-13 09:19:32 -07:00
John Baldwin
1a2520a3d7 ktls_test: Add a helper function to close sockets.
Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D35425

(cherry picked from commit 2c10520533)
2022-07-13 09:19:26 -07:00
John Baldwin
46b46bb774 hwpmc: Permit the minimum sampling count to be set as a sysctl.
A rarely occurring event (e.g. an event that occurs less than 1000
times during execution of a program) may require a lower minimum
threshold than 1000.  Replace the hardcoded 1000 with a sysctl that
the administrator can use to permit smaller sampling count values.

Reviewed by:	mhorne, mav
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D35400

(cherry picked from commit ca341f3cf5)
2022-07-13 09:19:13 -07:00
John Baldwin
4f8a3bb601 gcore: Don't hardcode VM write permissions.
This ensures read-only PT_LOAD segments are not marked as writable in
the phdr flags.

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35398

(cherry picked from commit 81c857dd7e)
2022-07-13 09:18:43 -07:00
John Baldwin
558cb98269 gcore: Remove unused elf_note_arm_vfp function.
Fixes:		add00c381e Use a regset for NT_ARM_VFP.
(cherry picked from commit ad52a7bb03)
2022-07-13 09:18:35 -07:00
John Baldwin
5e08ce7421 vmm: Destroy character devices synchronously.
This fixes a userland race where bhyveload or bhyve can fail to reuse
a VM name after bhyvectl --destroy has returned.

Reported by:	Michael Dexter
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D35186

(cherry picked from commit 7a0c23da4e)
2022-07-13 09:18:01 -07:00
John Baldwin
2473824a16 Don't implicitly pull in most of 'device crypto' for 'options IPSEC'.
options IPSEC is already documented as requiring 'device crypto' and
duplicating the dependencies is harder to read and not always
consistent.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33990

(cherry picked from commit 1d95c6f9c0)
2022-07-13 09:14:46 -07:00
John Baldwin
84d246823e check/delete-old: Auto-generate lib32 entries for libraries.
- Add usr/lib32/libfoo.so.N for lib/libfoo.so.N.

- Add usr/lib32/foo for usr/lib/foo.

- Treat casper libraries special since they are installed to
  /usr/lib32 instead of /usr/lib32/casper and thus map
  usr/lib/casper/foo to usr/lib32/foo.

Note that OLD_DIRS and MOVED_LIBS entries are not duplicated, only
OLD_FILES and OLD_LIBS.

Reviewed by:	imp, emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33324

(cherry picked from commit 77da558ceb)
2022-07-13 08:55:04 -07:00
Ed Maste
ff9082bd52 ObsoleteFiles: move libelf.so.2 to MOVED_LIBS
5a536241ea moved it from /usr/lib to /lib.  This case is now handled
using MOVED_LIBS.

Reported by:	dim
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 42818aba8d)
2022-07-13 08:44:50 -07:00
John Baldwin
29434f6ee7 Use MOVED_LIBS for the libalias modules being moved to /lib.
This is a bit more unusual in that the modules dropped their major
version suffix at the same time, so the old files being removed by
MOVED_LIBS in this case are the symlinks to the old libraries.

Reviewed by:	emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33849

(cherry picked from commit f033840b25)
2022-07-13 08:44:21 -07:00
John Baldwin
454aedb165 Use MOVED_LIBS for libraries moved between /usr/lib and /lib.
Add a MOVED_LIBS variable similar to OLD_LIBS except that MOVED_LIBS
is used for the cases that a library's name doesn't change, but it
just moves between /usr/lib and /lib.  This will be used by a future
change to auto-generate lib32 old files entries for which these cases
need to be ignored (a moved library remains in /usr/lib32).

Suggested by:	emaste
Reviewed by:	emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33848

(cherry picked from commit 57ba3f00f5)
2022-07-13 08:44:02 -07:00
John Baldwin
7344bc6cb7 Rework documentation of OLD_*.
- Be more explicit in the difference between OLD_DIRS and OLD_FILES
  (the former is only in delete-old-libs whereas the latter is in
  delete-old).

- Document that debug symbols in /usr/lib/debug/ for files in
  OLD_FILES and OLD_LIBS are removed as well.

Reviewed by:	emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33847

(cherry picked from commit c96dfb2156)
2022-07-13 08:34:26 -07:00
Stefan Eßer
2cead0f6df ObsoleteFiles.inc: Add comment regarding optional files
I had added entries that depended on some build option to this file
and have been informed, that those go into a different file in another
directory.

Mentioning /usr/src/tools/build/mk/OptionalObsoleteFiles.inc in this
file should help other committers (and me) to not repeat that mistake.

MFC after:	1 week

(cherry picked from commit 2a47875ea6)
2022-07-13 08:33:46 -07:00
John Baldwin
80e804d892 Remove lib32 versions of libl.
Reviewed by:	imp, emaste
Fixes:		eb61f7bdf2 Stop building libl and liby
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33851

(cherry picked from commit cc8af33eb3)
2022-07-13 08:31:41 -07:00
John Baldwin
72d2321142 Remove a duplicate entry for libgpib_p.a.
Reviewed by:	emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33850

(cherry picked from commit 768563cf23)
2022-07-13 08:22:24 -07:00
John Baldwin
b52bfacc1e Remove redundant OLD_FILES entries for debug symbols.
Entries for foo.debug files matching an existing entry in OLD_FILES or
OLD_LIBS are unnecessary as they are auto-generated.

Reviewed by:	imp, emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33777

(cherry picked from commit ebc1c24695)
2022-07-13 08:22:24 -07:00
John Baldwin
e3f9397aea Add list-old-{dirs,files,libs} targets.
These targets generate a raw list of the candidate old files roughly
corresponding to the values of OLD_DIRS, OLD_FILES, and OLD_LIBS.
Currently list-old-files also includes uncompressed manpages in
addition to compressed manpages.

Use these targets in the implementation of check-old-* and
delete-old-* to replace duplicated logic.

Reviewed by:	imp, emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33327

(cherry picked from commit 21baf42c57)
2022-07-13 08:22:24 -07:00
Mike Karels
913ebccc8e netstat -i: do not truncate interface names
The field for interface names for netstat -i was 5 characters by
default, which is no longer sufficient with names like "vlan1234"
and "vtnet0".  netstat -iW computed the necessary field width, but
also enlarged the address field by a lot (especially with IPv6 enabled).
Make netstat -i compute the field width for interface names with or
without -W.  Note that the existing default output does not fit in
80 columns in any case.  Update the man page accordingly, documenting
the remaining effect of -W with -i.  Also add -W to the list of
General Options, as there are numerous pointers to this.

Reported by:	Chris Ross
Reviewed by:	melifaro, rgrimes, cy
Differential Revision: https://reviews.freebsd.org/D35703

(cherry picked from commit 231092bb6f)
2022-07-13 08:20:03 -05:00
Dmitry Chagin
6fddab804a amd64: Reload CPU ext features after resume or cr4 changes
Reviewed by:		kib
Differential revision:	https://reviews.freebsd.org/D35555
MFC after:		2 weeks

(cherry picked from commit 050f5a8405)
2022-07-13 14:48:49 +03:00
Dmitry Chagin
34b00959fb linprocfs: Decode SGX CPU feature in cpuinfo
MFC after:		2 weeks

(cherry picked from commit c8e7070ce3)
2022-07-13 14:48:38 +03:00
Dmitry Chagin
9736c19884 linprocfs: Decode more CPU flags in cpuinfo
Differential revision:	https://reviews.freebsd.org/D35556
MFC after:		2 weeks

(cherry picked from commit 7ab03740ae)
2022-07-13 14:48:27 +03:00
Dmitry Chagin
f56ea6b7d0 linprocfs: Decode constant_tsc CPU feature
Differential revision:	https://reviews.freebsd.org/D35554
MFC after:		2 weeks

(cherry picked from commit 8da00a514e)
2022-07-13 14:48:14 +03:00
Warner Losh
82a8b8f0cf lastcomm/sa: Remove sparc64 tests, they aren't needed.
Fix delete-old, since 22375931 MFC, annoy to delete them manually
every make delete-old.

These tests will run only on a sparc64 system, and so never run anymore.

Sponsored by:		Netflix

(cherry picked from commit d6dffbae96)
2022-07-13 14:17:40 +03:00
Konstantin Belousov
c41bc56574 ufs_rename(): revert the bump of fvp nlink count in case of EMLINK for tdvp
(cherry picked from commit 513e1bbc73)
2022-07-13 11:38:01 +03:00
Konstantin Belousov
a924a143dd ufs_rename(): do not treat ERELOOKUP specially
(cherry picked from commit ab5ef5fb63)
2022-07-13 11:38:01 +03:00
Konstantin Belousov
0aa68d5fbe UFS rename: make it reliable when using SU and reaching nlink limit
PR:	165392

(cherry picked from commit bc6d0d72f4)
2022-07-13 11:38:01 +03:00
Doug Moore
0a7f5f1885 mips busdma: expunge an extra closing brace
A merge left a dangling right brace unaccounted for.
Delete it.

Reported by:	jenkins
2022-07-12 13:47:44 -05:00
Dimitry Andric
72e9fd9daa Apply tentative llvm fix for avoiding fma on PowerPC SPE
Merge llvm review D77558, by Justin Hibbits:

  PowerPC: Don't hoist float multiply + add to fused operation on SPE

  SPE doesn't have a fmadd instruction, so don't bother hoisting a
  multiply and add sequence to this, as it'd become just a library call.
  Hoisting happens too late for the CTR usability test to veto using the CTR
  in a loop, and results in an assert "Invalid PPC CTR loop!".

Reported by:		alfredo
Obtained from:		https://reviews.llvm.org/D77558
MFC after:		3 days

(cherry picked from commit 9ef1127008)
2022-07-12 20:29:55 +02:00
Dimitry Andric
b36f85590d Apply clang fix for assertion building llvm with libc++ 15
Merge commit f1b0a4fc540f from llvm git (by Richard Smith):

  An expression should only contain an unexpanded parameter pack if it
  lexically contains a mention of the pack.

  Systematically distinguish between syntactic and semantic references to
  packs, especially when propagating dependence from a type into an
  expression. We should consult the type-as-written when computing
  syntactic dependence and should consult the semantic type when computing
  semantic dependence.

  Fixes #54402.

MFC after:	3 days

(cherry picked from commit 3b7f365e4d)
2022-07-12 20:29:46 +02:00
Doug Moore
069ec467c1 iommu_gas: Drop needless bound check in lowermatch
The loop iteration in iommu_gas_lowermatch checks the bound
a->common->lowaddr twice per loop iteration. Rewrite to test only once
per iteration.  Do not worry about passing to iommu_gas_match_one a
range wholly beyond lowaddr. Since that function checks the upper end
of the range against lowaddr, it'll get rejected there.

Reviewed by:	alc
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D35522

(cherry picked from commit 70b5d8fa0f)
2022-07-12 12:37:48 -05:00
Doug Moore
094bcfa4e1 mips_busdma: fix mips errors after merge
The change "vm_extern: use standard address checkers everywhere"
introduced bugs, as well as features, into head. After it was
introduced, but before those bugs were addressed, mips support was
dropped from head, so those mips bugs were never fixed in head. Now,
that change and those fixes have been merged into stable/13. This
change fixes two of those bugs that were fixed everywhere else but
never in mips.

Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D35793
2022-07-12 12:33:20 -05:00