Commit Graph

23199 Commits

Author SHA1 Message Date
Ed Maste
a8a43edc0f libc: ANSIfy div / ldiv function definitions
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-07-28 10:32:48 -04:00
Alfredo Dal'Ava Junior
a12eb9e4ae Revert "csu: test: explicitly add libm as build parameter"
This reverts commit 4f5890a0fb.

9ef1127008 is a proper fix for
the problem we tried to address.

Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
2022-07-28 11:23:26 -03:00
Corvin Köhne
56b8f5b111 bhyve: Initialize more registers in vcpu_reset()
- Clear CR2, EFER, and R8-15 to zero.
- Reset DR6 and DR7 to their documented reset values.
- Reset interrupt shadow state.
- Document the reason CR0 is reset to a value that doesn't match its
documented value.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D35622
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-07-27 18:20:47 +02:00
Aleksandr Rybalko
cedbdaf0e5 Add pmc.dmc-620(3) man page.
Reviewed by:	pauamma
Sponsored By:	Ampere Computing
Differential Revision:	https://reviews.freebsd.org/D32669
2022-07-26 11:17:50 +03:00
Kirk McKusick
82e72f1d12 Add d_sblockloc to libufs(3) disk structure to allow options to be added.
By making the disk block parameter used by the libufs(3) sbread(3)
function visible, applications using sbread(3) can set their own
addition options such as using the STDSB_NOHASHFAIL request to
say that they want the superblock read to succeed even when
the superblock checkhash is incorrect.

While here also add an error message when a check-hash failure
is detected.
2022-07-24 18:12:25 -07:00
Kristof Provost
e4c36b7aa9 libnv: bump library version
Now that we version symbols we should bump the library major version.
While here use version FBSD_1.7 to match the current HEAD FreeBSD
namespace and remove extraneous 'All rights reserved' and incorrect
copyright statement.

Reviewed by:	kevans
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35875
2022-07-22 00:23:08 +02:00
Mateusz Piotrowski
a848315f68 gmirror.8: Remove references rc.early
The manual page of gmirror describes how gmirror providers can be used
for kernel dumps. Unfortunately, the instruction references
/etc/rc.early, which is no longer a part of rc(8).

Remove references to rc.early and suggest creating an rc(8) service
script instead.

Future work: In the Problem Report on Bugzilla, Lawrence Chen suggested
adding example rc(8) scripts to the gmirror. However, those examples
need to be tested before they become official reference examples in the
base. Also, those scripts should probably land directly to /etc/rc.d,
/usr/share/examples/rc.d, or /usr/share/examples/gmirror instead of the
gmirror manual page.

PR:		178818
Reported by:	Lawrence Chen <beastie@tardisi.com>
Fixes:		dd2b024a33 Removal of early.sh
MFC after:	1 week
2022-07-21 22:02:44 +02:00
Reid Linnemann
000321bab7 namespace nv names, version libnv and libnvpair library symbols
libnv and libnvpair have aliased symbols, and as a result a single process which
dlopens a shared object that is dynamically linked to libnv and another to
libnvpair will wind up with a single set of resolved symbols for those in
conflict. A source file also cannot include both libnv and libnvpair headers
because of aliased identifiers. To resolve the situation, libnv types and
functions are namespaced via nv_namespace.h, and libnv symbols are
versioned. The msgio functions are not namespaced or exported as they are not
part of the external API.

Reviewed by:	kevans
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35261
2022-07-21 18:35:23 +02:00
Ed Maste
560e22c8fe Remove "All Rights Reserved" from FreeBSD Foundation libc copyrights
As per the updated FreeBSD copyright template.  These were unambiguous
cases where the Foundation was the only listed copyright holder.

Sponsored by:	The FreeBSD Foundation
2022-07-21 09:53:31 -04:00
Hans Petter Selasky
280f34c37c cuse(3): Make some clarifications in the manual page.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-07-20 10:41:11 +02:00
Hans Petter Selasky
58a8f6e9ec cuse(3): Allow allocating a memory buffer of exactly 2 GBytes.
The manual page date will be bumped separately.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-07-20 10:41:11 +02:00
Hans Petter Selasky
d14b53ee31 cuse(3): Allow shared memory allocations up to, but excluding 2 GBytes.
Currently the cuse(3) mmap(2) offset is split into 128 banks of 16 Mbytes.
Allow cuse(3) to make allocations that span multiple banks at the expense
of any fragmentation issues that may arise. Typically mmap(2) buffers are
well below 16 Mbytes. This allows 8K video resolution to work using webcamd.

Reviewed by:	markj @
Differential Revision:	https://reviews.freebsd.org/D35830
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-07-20 10:41:11 +02:00
Hans Petter Selasky
2ca43c3dba cuse(3): Make cuse_vmfree() NULL safe.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-07-20 10:41:11 +02:00
Simon J. Gerraty
ab4f0a1518 Add -S option to veriexec
During software installation, use veriexec -S to strictly
enforce certificate validity checks (notBefore, notAfter).

Otherwise ignore certificate validity period.
It is generally unacceptible for the Internet to stop working
just because someone did not upgrade their infrastructure for a decade.

Sponsored by:	Juniper Networks, Inc.

Reviewed by:	sebastien.bini_stormshield.eu
Differential Revision:	https://reviews.freebsd.org/D35758
2022-07-19 08:59:53 -07:00
Kirk McKusick
90e29718cf Clarify when GEOM utilities exit with success or failure.
Historically, GEOM utilities (gpart(8), gstripe(8), gmirror(8),
etc) used the gctl_error() routine to report errors. If they called
gctl_error() they would exit with EXIT_FAILURE, otherwise they would
return with EXIT_SUCCESS. If they used gctl_error() to output an
informational message, for example when run with the -v (verbose)
option, they would mistakenly exit with EXIT_FAILURE. A further
limitation of the gctl_error() function was that it could only be
called once. Messages from any additional calls to gctl_error()
would be silently discarded.

To resolve these problems a new function, gctl_msg() has been added.
It can be called multiple times to output multiple messages. It
also has an additional errno argument which should be zero if it is
an informational message or an errno value (EINVAL, EBUSY, etc) if
it is an error. When done the gctl_post_messages() function should
be called to indicate that all messages have been posted. If any
of the messages had a non-zero errno, the utility will EXIT_FAILURE.
If only informational messages (with zero errno) were posted, the
utility will EXIT_SUCCESS.

Tested by:   Peter Holm
PR:          265184
MFC after:   1 week
2022-07-16 10:26:51 -07:00
Dimitry Andric
e50027e38d Remove unnecessary const and volatile qualifiers from __fp_type_select()
Since https://github.com/llvm/llvm-project/commit/ca75ac5f04f2, clang 15
has a new warning about _Generic selection expressions, such as used in
math.h:

    lib/libc/gdtoa/_ldtoa.c:82:10: error: due to lvalue conversion of the controlling expression, association of type 'volatile float' will never be selected because it is qualified [-Werror,-Wunreachable-code-generic-assoc]
            switch (fpclassify(u.e)) {
                    ^
    lib/msun/src/math.h:109:2: note: expanded from macro 'fpclassify'
            __fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyl)
            ^
    lib/msun/src/math.h:85:14: note: expanded from macro '__fp_type_select'
        volatile float: f(x),                                               \
                 ^

This is because the controlling expression always undergoes lvalue
conversion first, dropping any cv-qualifiers. The 'const', 'volatile',
and 'volatile const' associations will therefore never be used.

MFC after:	1 week
Reviewed by:	theraven
Differential Revision: https://reviews.freebsd.org/D35815
2022-07-15 20:09:27 +02:00
Yi Kong
7e06f4708c
msun: Rewrite function definitions with identifier lists
This syntax is removed in C2x proposal N2432.

Reviewed by:	pfg
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D35771
2022-07-12 13:17:47 +08:00
Vitaliy Gusev
1228a047aa libvmm: add __BEGIN_DECLS/__END_DECLS for linking with c++ binaries
Reviewed by:	jhb, markj, imp
Sponsored by:	vStack
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35719
2022-07-11 15:58:42 -04:00
Xin LI
0bbf270296 libproc: replace home grown crc32 with zlib implementation.
MFC after:	2 weeks
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D35766
2022-07-10 16:31:35 -07:00
Aleksandr Rybalko
da4e1e319c Add the Arm CoreLink CMN-600 Coherent Mesh Network Controller PMU driver man page.
Add the Arm CoreLink CMN-600 Coherent Mesh Network Controller PMU driver man page.

Reviewed by:	pauamma_gundo.com
Sponsored By: ARM
Differential Revision: https://reviews.freebsd.org/D32335
2022-07-10 12:26:55 +03:00
Mateusz Piotrowski
16e4487e5f clock_gettime.2: Clarify CLOCK_*
Clarify that CLOCK_* (e.g., CLOCK_REALTIME) do not necessarily default
to CLOCK_*_FAST.

PR:		259642
2022-07-08 21:57:24 +02:00
Mateusz Piotrowski
13a9da7d55 clock_gettime.2: Add cross references and fix linter warnings
MFC after:	3 days
2022-07-08 21:51:03 +02:00
Alfredo Dal'Ava Junior
4f5890a0fb csu: test: explicitly add libm as build parameter
CSU tests build fails with '/usr/lib/libgcc_s.so: undefined reference to
fma' when built with LLVM 14 for powerpcspe, so '-lm' is being added
explicitly.

It may be linked to https://reviews.llvm.org/D77558

Reviewed by:	imp (earlier version)
MFC after:	2 days
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D35691
2022-07-07 20:58:04 -03:00
John Baldwin
0b09867f67 Simplify conditional guards for libclang_rt.
All supported architectures can build libclang_rt now.

Reviewed by:	dim
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35740
2022-07-07 13:54:57 -07:00
Mitchell Horne
6f50b73ee5 libpmc: add armv8 pmu-event aliases
These are all "standard microarchitectural events", which in theory are
supported by every ARMv8 processor. In practice, it depends on the
pmu-event definitions being complete and accurate, which they are not
for every processor. Still, these aliases should be functional on the
majority of systems.

PR:		254532
Reported by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35550
2022-07-06 14:32:21 -03:00
Mitchell Horne
9d97138e2d libpmc: import updated pmu-events for arm64
Thanks to the recently updated import of the jevents utility by mav@, we
can now compile the latest version of these event definitions. This
should support a wider set of common ARMv8 processors, for example, the
Cortex-A72 in the Raspberry Pi 4.

This brings this folder in sync with Linux commit 62e6eb8d5454.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35549
2022-07-06 14:32:21 -03:00
Xin LI
a4d6d3b891 file: upgrade to 5.42.
MFC after:	2 weeks
2022-07-03 17:11:09 -07:00
Gordon Bergling
6cea3be922 sockatmark(3): Add references to 4.4BSD IPC tutorials
Obtained from:	NetBSD
MFC after:	3 days
2022-07-03 15:56:42 +02:00
Gordon Bergling
a4adfaf712 pmc(3): Fix a common typo in a description
- s/transistioned/transitioned/

MFC after:	3 days
2022-07-03 13:53:01 +02:00
Warner Losh
ef86876b84 pselect(2): Document what a null pointer for the signalmask means
When pselect is passed a null pointer for the signal mask, the standard
says it shall behave like select (except for the different timeout
arg). Make a note of that here.

Sponsored by:		Netflix
2022-07-02 13:41:46 -06:00
Vitaliy Gusev
f0880ab791 libvmmapi: Add vm_close()
Currently there is no way to safely free a vm structure without
leaking the fd.  vm_destroy() closes the fd but also destroys the VM
whereas in some cases a VM needs to be opened (vm_open) and then
closed (vm_close).

Reviewed by:	jhb
Sponsored by:	vStack
Differential Revision:	https://reviews.freebsd.org/D35073
2022-06-30 14:21:57 -07:00
John Baldwin
21d2d29f59 libclang_rt: Trim a few more MIPSisms.
The only FreeBSD architectures ending in 'hf' were MIPS hard-float
architectures.

Reviewed by:	emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35591
2022-06-30 10:02:37 -07:00
Mark Johnston
b8ec0ce5b4 wait.2: Remove sys/types.h from the list of required headers
wait.h is self-contained.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-30 10:31:26 -04:00
Mark Johnston
ec014502ee libsysdecode: Grab some more ioctl definitions from CAM
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-30 10:31:26 -04:00
Gleb Smirnoff
48a55bbfe9 unix: change error code for recvmsg() failed due to RLIMIT_NOFILE
Instead of returning EMSGSIZE pass the error code from fdallocn() directly
to userland.  That would be EMFILE, which makes much more sense.  This
error code is not listed in the specification[1], but the specification
doesn't cover such edge case at all.  Meanwhile the specification lists
EMSGSIZE as the error code for invalid value of msg_iovlen, and FreeBSD
follows that, see sys_recmsg().  Differentiating these two cases will make
a developer/admin life much easier when debugging.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvmsg.html

Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35640
2022-06-29 09:42:58 -07:00
Wojciech Macek
e6ef5042e4 libsecureboot: Do not propagate empty string
If Trust Anchors are provided by UEFI and not compiled into
libsecureboot the segmentation fault occurs due to empty
or NULL string usage.

Obtained from:		Semihalf
Reviewed by:		sjg
Differential revision:	https://reviews.freebsd.org/D35120
2022-06-29 10:50:23 +02:00
Fernando Apesteguía
4a3c598f35 Bump .Dd for recently modified manual pages
During the removal of named(8) references, some pages were modified but their
.Dd where not updated accordingly.

Reported by:	lwhsu@
Fixes:	942e234d86
2022-06-27 18:20:03 +02:00
Bjoern A. Zeeb
dd2fd62184 libpmc: attempt to fix the build
Try to fix the build (blindly) after e3572eb654.
I had missed the missing #ifdef in the review.  Hope that's all it takes.
2022-06-26 23:14:56 +00:00
Aleksandr Rybalko
e3572eb654 Allocate event for DMC-620 and CMN-600 controllers PMU. Add events supported by DMC-620 and CMN-600 controllers PMU.
Allocate event for DMC-620 and CMN-600 controllers PMU.
Add events supported by DMC-620 and CMN-600 controllers PMU.

Reviewed by: bz
Sponsored By: ARM
Sponsored By: Ampere Computing
Differential Revision: https://reviews.freebsd.org/D35609
2022-06-26 21:52:26 +03:00
Fernando Apesteguía
942e234d86 Remove references to named(8)
named(8) hasn't been in base for some time. Remove all references to it in
manual pages.

Approved by:	manpages (Pau Amma)
Differential Revision:	https://reviews.freebsd.org/D35586
2022-06-26 18:53:08 +02:00
Aleksandr Rybalko
b6e28991bf System wide and NUMA domain wide counters support. PMC classes for ARM DMC-620 and CMN-600.
Add support for system wide and NUMA domain wide counters support.
Add 3 new PMC classes for ARM DMC-620 and CMN-600 controllers PMU.

Reviewed by:	mhorne
Sponsored By:	ARM
Sponsored By:	Ampere Computing
Differential Revision: https://reviews.freebsd.org/D35342
2022-06-26 08:31:03 +03:00
Hans Petter Selasky
2c28cd09d9 cuse(3): Remove PAGE_SIZE from libcuse.
To allow for a dynamic page size on arm64 remove the static value from libcuse.

Differential Revision:	https://reviews.freebsd.org/D35585
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-06-25 12:01:59 +02:00
Gleb Smirnoff
ddc6890519 libc/syslog: deprecate use of "/var/run/logpriv"
This additional socket was created in 2e89951b6f and 240d5a9b1c
to try workaround problems with classic PF_UNIX/SOCK_DGRAM sockets.

With recent changes in kernel this trick is no longer needed, so the
trick can be reverted.

In syslogd(8) we would still create the socket for the next several
major releases for compatibility.

Differential revision:	https://reviews.freebsd.org/D35305
2022-06-24 09:09:11 -07:00
Gleb Smirnoff
f9e62cbacc libc/syslog: fully deprecate and don't try to open "/dev/log"
The "/dev/log" socket existed in pre-FreeBSD times.  Later it was
substituted to a compatibility symlink.  The symlink creation was
deprecated in FreeBSD 10.2 and 9-STABLE.

Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35304
2022-06-24 09:09:11 -07:00
Dmitry Chagin
ed366c37d8 libsysdecode: Fix a typo in my email
Reported by:		Mikaël Urankar
MFC after:		2 weeks
2022-06-23 12:29:29 +03:00
Dmitry Chagin
fde775bc53 libsysdecode: Decode Linux open() flags
MFC after:		2 weeks
2022-06-22 14:26:10 +03:00
Dmitry Chagin
d2b3237eeb libsysdecode: Decode Linux *at() flags
MFC after:		2 weeks
2022-06-22 14:25:36 +03:00
Dmitry Chagin
39de84b619 kdump: Decode Linux clock_nanosleep syscall
MFC after:		2 weeks
2022-06-22 14:21:42 +03:00
Dmitry Chagin
f587a2a765 kdump: Decode Linux sigprocmask how argument
MFC after:		2 weeks
2022-06-22 14:20:39 +03:00
Dmitry Chagin
2fc3a51db1 libsysdecode: Decode setitimer, getitimer which argument
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D35230
MFC after:		2 weeks
2022-06-22 14:17:10 +03:00