Commit Graph

24456 Commits

Author SHA1 Message Date
rilysh
84970eab6a libc(xdr.c): fix "discriminated" spelling
From "descriminated" to "discriminated".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119
2024-04-12 16:34:52 -06:00
rilysh
9a7f7b2480 libc(inet_net_pton.c): fix "Fiery" spelling
From "Firey" to "Fiery".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119
2024-04-12 16:34:51 -06:00
rilysh
2f1da80f21 libc(localeconv.c): fix "appropriate" spelling
From "approprate" to "appropriate".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119
2024-04-12 16:34:51 -06:00
Henri Chataing
2b2cd97844 msun: Fix math error in comment explaining y reduction
x = k + y for some integer k and |y| < 1/2
exp2(x) = exp2(k + y) = exp2(k) * exp2(y)
which can be written as 2**k * exp2(y)

The original had x = 2**k + y, which is has an extra 2** in it which
isn't correct.

Confirmed by forumula 2 in Gal and Bachelis referenced in the comments
for the source of this method
	https://dl.acm.org/doi/pdf/10.1145/103147.103151

The actual code is correct.

Reviewed by: imp (who added s_exp2.c and wrote the commit message)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1127
2024-04-12 16:15:04 -06:00
Minsoo Choo
7c7299df76 libc: Remove support for pre-C99 C standards
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D43254
2024-04-12 12:05:09 -07:00
Collin Funk
22ddb5bb83 math: Add long double constant definitions
These constants are GNU libc extensions that are likely to be adopted
by the next POSIX revision [1]. The definitions can be verified in
a PARI-GP shell session:

* M_El: exp (1)
* M_LOG2El: log (exp (1)) / log (2)
* M_LOG10El: log (exp (1)) / log (10)
* M_LN2l: log (2)
* M_LN10l: log (10)
* M_PIl: Pi
* M_PI_2l: Pi / 2
* M_PI_4l: Pi / 4
* M_1_PIl: 1 / Pi
* M_2_PIl: 2 / Pi
* M_2_SQRTPIl: 2 / sqrt (Pi)
* M_SQRT2l: sqrt (2)
* M_SQRT1_2l: 1 / sqrt (2)

[1] https://austingroupbugs.net/view.php?id=828

Put these behind __BSD_VISIBLE || __XSI_VISIBLE >= 800 to future-proof
these changes. They shouldn't be defined at lower levels of XSI, but don't
have other XSI 800 stuff in place yet.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed by: imp, allanjude
Pull Request: https://github.com/freebsd/freebsd-src/pull/1121
2024-04-12 12:30:58 -06:00
Mark Murray
737799dfd3 Now that D44168 has been merged to stable/14, update the manpage
to correctly reflect history.
2024-04-12 16:33:54 +01:00
Dimitry Andric
442d351bd2 libllvm: add missed tlbgen headers and sources for BPF target
Noticed by:	vishwin
PR:		276104
MFC after:	1 month
2024-04-11 00:10:13 +02:00
Mark Johnston
56a26fc1af libvmmapi: Conditionalize compilation of some functions
Hide definitions of several functions that currently don't have
implementatations in the arm64 vmm port.  In particular, add a
WITH_VMMAPI_SNAPSHOT preprocessor variable that can be used to enable
compilation of save/restore functions, and conditionalize compilation of
some functions only used by amd64 bhyve.  If in the long term they
remain amd64-only, they can move to vmmapi_machdep.c, but for now it's
not clear to me that that's the right thing to do.

MFC after:	2 weeks
Sponsored by:	Innovate UK
2024-04-10 11:17:56 -04:00
Mark Johnston
11c79f9e35 arm64: Connect bhyve and libvmmapi to the build
Reviewed by:	corvink, andrew, jhb, emaste
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41742
2024-04-10 11:17:56 -04:00
Mark Johnston
e499fdcb66 libvmmapi: Zero out the structure passed to VM_GET_MEMSEG
Avoid assuming that the kernel zeros the name buffer, it does not do
this for zero-length segments.

MFC after:	2 weeks
Sponsored by:	Innovate UK
2024-04-10 11:17:56 -04:00
Mark Johnston
1855002ddf libvmmapi: Make vm_raise_msi() a common function
Currently, bhyve PCI emulation uses vm_lapic_msi() to raise an MSI in
the guest.  The arm64 port has a similar function, vm_raise_msi().
Add vm_raise_msi() on amd64 as well and have it simply call
vm_lapic_msi() so that bhyve can use a common, generically named
function.

Reviewed by:	corvink, andrew, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41752
2024-04-10 11:17:56 -04:00
Mark Johnston
5ec6c3007e libvmmapi: Add arm64 support
- Define wrappers for some MD ioctls.
- Provide a list of vmm device ioctls for cap_ioctl_limit().
- Disable use of the lowmem region.

Reviewed by:	corvink
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41005
2024-04-10 11:17:56 -04:00
Mark Johnston
7e0fa79412 libvmmapi: Make memory segment handling a bit more abstract
libvmmapi leaves a hole at [3GB, 4GB) in the guest physical address
space.  This hole is not used in the arm64 port, which maps everything
above 4GB.  This change makes the code a bit more general to accomodate
arm64 more naturally.  In particular:

- Remove vm_set_lowmem_limit(): it is unused and doesn't have
  well-defined constraints, e.g., nothing prevents a consumer from
  setting a lowmem limit above the highmem base.
- Define a constant for the highmem base and use that everywhere that
  the base is currently hard-coded.
- Make the lowmem limit a compile-time constant instead of a vmctx field.
- Store segment info in an array.
- Add vm_get_highmem_base(), for use in bhyve since the current value is
  hard-coded in some places.

No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41004
2024-04-10 11:17:56 -04:00
Mark Johnston
8b06bdc91d libvmmapi: Move PCI passthrough ioctl wrappers into a separate file
The arm64 port doesn't implement PCI passthrough and in particular
doesn't define the ioctls used by these wrappers.  It might be that the
ppt ioctl interface will require modification to support arm64.  Until
that's sorted out one way or another, put this code in a separate file
so that it's easy to conditionally compile.

No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41003
2024-04-10 11:17:56 -04:00
Mark Johnston
3170dcaea9 libvmmapi: Move more amd64-specific ioctl wrappers to vmmapi_machdep.c
No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41002
2024-04-10 11:17:56 -04:00
Mark Johnston
7f00e46b85 libvmmapi: Split the ioctl list into MI and MD lists
To enable use in capability mode, libvmmapi needs a list of all the
ioctls that might be invoked on the vmm device handle.  Some of these
ioctls are amd64-specific.  Move the ioctl list to vmmapi_machdep.c and
define a list of MI ioctls so that the arm64 port can build its own list
without duplicating common ioctls.  No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41001
2024-04-10 11:17:56 -04:00
Mark Johnston
85efb31d50 libvmmapi: Move VM capability names to vmmapi_machdep.c
Add some missing entries while here.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D41000
2024-04-10 11:17:55 -04:00
Mark Johnston
e4656e10d1 libvmmapi: Move some ioctl wrappers to vmmapi_machdep.c
ioctls relating to segments and various x86-specific interrupt
controllers are easy candidates to move to vmmapi_machdep.c.

In vmmapi.h I'm just ifdefing MD prototypes for now.  We could instead
split vmmapi.h into multiple headers, e.g., vmmapi.h and
vmmapi_machdep.h, but it's not obvious to me yet that that's the right
approach.

No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40999
2024-04-10 11:17:55 -04:00
Mark Johnston
967264cfcd libvmmapi: Add a subdirectory for amd64-specific code
Move vmmapi_freebsd.c there.  It contains x86-specific code used only by
bhyveload(8).

Move vcpu_reset() into vmmapi_machdep.c.  It is also x86-specific.

No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40998
2024-04-10 11:17:55 -04:00
Graham Perrin
763f5da97d libbe(3): history: fix
'bectl(8) and libbe' (not 'libbe and libbe(3)').

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/857
2024-04-09 22:01:10 -06:00
Graham Perrin
04610d665e libbe(3): consistency, and authors
Consistency with the manual page for bectl(8), including addition of an
AUTHORS section.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/857
2024-04-09 22:01:06 -06:00
rilysh
2a3d453049 exit.3: add the comma after an empty space
exit(3) man page shows __cxa_atexit(3,) instead of __cxa_atexit(3), in a
particular section. It seems the comma gets inside the parenthesis and
with an extra space, it can be viewed as expected.

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1006
2024-04-09 21:38:01 -06:00
Rob Norris
b6c7ff583f libvmmapi: add missing capability strings
Signed-off-by: Rob Norris <robn@despairlabs.com>

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44642
2024-04-08 09:08:59 -04:00
Dimitry Andric
4c983a2886 libcompiler_rt Makefile.inc: include bsd.compiler.mk to fix build
Apparently libgcc_s has always included libcompiler_rt's Makefile.inc
without first including bsd.compiler.mk, even though Makefile.inc used
COMPILER_TYPE already. It looks like we were just lucky that the
expression was not malformed.

PR:		276104
Reported by:	Herbert J. Skuhra <herbert@gojira.at>
MFC after:	1 month
2024-04-07 21:45:51 +02:00
Dimitry Andric
2e226748a9 libcompiler_rt Makefile.inc: don't build bfloat16 support for gcc < 13
Older versions of gcc produce "error: unknown type name '__bf16'".

PR:		276104
MFC after:	1 month
2024-04-07 20:21:01 +02:00
Dimitry Andric
d00b9344bb libcompiler_rt Makefile.inc: remove debugging messages
PR:		276104
MFC after:	1 month
2024-04-07 20:16:52 +02:00
Dimitry Andric
439352ac82 Merge llvm-project release/18.x llvmorg-18.1.3-0-gc13b7485b879
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.3-0-gc13b7485b879.

PR:		276104
MFC after:	1 month
2024-04-06 22:14:34 +02:00
Dimitry Andric
4c2d3b022a Merge llvm-project release/18.x llvmorg-18.1.1-0-gdba2a75e9c7e
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.1-0-gdba2a75e9c7e.

PR:		276104
MFC after:	1 month
2024-04-06 22:14:25 +02:00
Dimitry Andric
56727255ad Merge llvm-project release/18.x llvmorg-18.1.0-rc3-0-g6c90f8dd5463
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.0-rc3-0-g6c90f8dd5463.

PR:		276104
MFC after:	1 month
2024-04-06 22:14:19 +02:00
Dimitry Andric
74626c16ff Merge llvm-project release/18.x llvmorg-18.1.0-rc2-53-gc7b0a6ecd442
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.0-rc2-53-gc7b0a6ecd442.

PR:		276104
MFC after:	1 month
2024-04-06 22:14:13 +02:00
Dimitry Andric
b3edf44679 Merge llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967.

PR:		276104
MFC after:	1 month
2024-04-06 22:14:07 +02:00
Dimitry Andric
878ed4957e Merge llvm-project release/18.x llvmorg-18-init-18361-g22683463740e
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18-init-18361-g22683463740e.

PR:		276104
MFC after:	1 month
2024-04-06 22:13:56 +02:00
Dimitry Andric
7a6dacaca1 Merge llvm-project main llvmorg-18-init-18359-g93248729cfae
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-18359-g93248729cfae, the
last commit before the upstream release/18.x branch was created.

PR:		276104
MFC after:	1 month
2024-04-06 22:13:49 +02:00
Dimitry Andric
297eecfb02 Merge llvm-project main llvmorg-18-init-16864-g3b3ee1f53424
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-16864-g3b3ee1f53424.

PR:		276104
MFC after:	1 month
2024-04-06 22:13:39 +02:00
Dimitry Andric
1db9f3b21e Merge llvm-project main llvmorg-18-init-16595-g7c00a5be5cde
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-16595-g7c00a5be5cde.

PR:		276104
MFC after:	1 month
2024-04-06 22:13:28 +02:00
Dimitry Andric
647cbc5de8 Merge llvm-project main llvmorg-18-init-16003-gfc5f51cf5af4
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-16003-gfc5f51cf5af4.

PR:		276104
MFC after:	1 month
2024-04-06 22:13:16 +02:00
Dimitry Andric
cb14a3fe51 Merge llvm-project main llvmorg-18-init-15692-g007ed0dccd6a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-15692-g007ed0dccd6a.

PR:		276104
MFC after:	1 month
2024-04-06 22:13:06 +02:00
Dimitry Andric
5f757f3ff9 Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fb
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-15088-gd14ee76181fb.

PR:		276104
MFC after:	1 month
2024-04-06 22:11:55 +02:00
Xin LI
5ffb19ac36 Backport export of lzma_mt_block_size symbol.
This restores binary compatibility against liblzma 5.6.0 library.

PR:		278127
MFC after:	3 days
2024-04-04 23:39:33 -07:00
Xin LI
2f9cd13d6c Revert "MFV: xz 5.6.0"
This commit reverts 8db56defa7,
rolling back the vendor import of xz 5.6.0 and restoring the
package to version 5.4.5.

The revert was not directly due to the attack (CVE-2024-3094):
our import process have removed the test cases and build scripts
that would have enabled the attack. However, reverting would
help to reduce potential confusion and false positives from
security scanners that assess risk based solely on version
numbers.

Another commit will follow to restore binary compatibility with
the liblzma 5.6.0 library by making the previously private
symbol (lzma_mt_block_size) public.

PR:		278127
MFC after:	3 days
2024-04-04 23:39:23 -07:00
Christopher Davidson
d3de1bd429 open.2: remove self-reference
Change .Xr reference to .Fn, which quiets a mandoc warning.

Reviewed by:	mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1135
2024-04-03 13:55:24 -03:00
Gleb Smirnoff
1a8d176432 inpcb: fully retire inp_ppcb pointer
Before a protocol specific control block started to embed inpcb in self
(see 0aa120d52f, e68b379244, 483fe96511) this pointer used to point
at it.

Retain kf_sock_inpcb field in the struct kinfo_file in <sys/user.h>.  The
exp-run detected a minimal use of the field in ports:
  * sysutils/lsof - patched upstream
  * net-mgmt/netdata  - patch accepted upstream
  * emulators/qemu-user-static - upstream master branch seems not using
    the field anymore
We can keep the field around for some time, but eventually it may be
reused for something else.

PR:			277659 (exp-run)
Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D44491
2024-03-29 12:18:32 -07:00
Stephen J. Kiernan
39f6f6f1c6 libmagic: Use HOST_CC when compiling hostprog used by build
The "mkmagic" program should be built with the host compiler.

Only use BTOOLSPATH if not building for host

Obtained from:	Juniper Networks, Inc.
Reviewed by:	sjg
Differential Revision:	https://reviews.freebsd.org/D44539
2024-03-27 19:18:43 -04:00
Dag-Erling Smørgrav
7534109d13 libc: Improve description of mktime() / timegm().
* Mention that mktime() and timegm() set errno on failure.
* Correctly determining whether mktime() / timegm() succeeded with
  arbitrary input (where -1 can be a valid result) is non-trivial.
  Document the recommended procedure.

PR:		277863
MFC after:	1 week
Reviewed by:	pauamma_gundo.com, gbe
Differential Revision:	https://reviews.freebsd.org/D44503
2024-03-27 11:03:37 +01:00
Dag-Erling Smørgrav
d9a9f23d0b diff: Integrate libdiff from OpenBSD GoT.
This adds support for two new diff algorithms, Myers diff and Patience
diff.

These algorithms perform a different form of search compared to the
classic Stone algorithm and support escapes when worst case scenarios
are encountered.

Add the -A flag to allow selection of the algorithm, but default to
using the new Myers diff implementation.

The libdiff implementation currently only supports a subset of input and
output options supported by diff.  When these options are used, but the
algorithm is not selected, automatically fallback to the classic Stone
algorithm until support for these modes can be added.

Based on work originally done by thj@ with contributions from kevans@.

Sponsored by:	Klara, Inc.
Reviewed by:	thj
Differential Revision:	https://reviews.freebsd.org/D44302
2024-03-27 11:03:33 +01:00
Ka Ho Ng
fb860ed0c5 libfetch: parse scheme://domain:/ correctly
This improves URL-parsing compability with cURL, and unbreaks parsing of
similar kinds of URLs after commit 8d9de5b10a.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	des
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44493
2024-03-25 16:11:42 -04:00
Gordon Bergling
577a721d05 xdr(3): Fix a few typos in source code comments
- s/reoutines/routines/
- s/paraemters/parameters/

Obtained from:	NetBSD
MFC after:	3 days
2024-03-23 08:43:41 +01:00
Kristof Provost
88f557a2a9 libpfctl: fix incorrect labels copy
We copied the entire parsed_labels struct, including the counter to a
field that was only big enough for the labels (so not the counter).

PR:		277875
MFC after:	1 week
2024-03-22 09:00:05 +01:00
Brooks Davis
312a05c39e riscv: remove more riscv64sf support
Remove a few more bits of riscv64sf support in libc and libm.

Reduce floating point ABI checks to requiring double hard float.

Reviewed by:	imp, jhb
Fixes:		1ca12bd927 Remove the riscv64sf architecture.
Differential Revision:	https://reviews.freebsd.org/D44334
2024-03-21 23:48:37 +00:00