Commit Graph

21222 Commits

Author SHA1 Message Date
Emmanuel Vadot
27a7ae0ce0 pkgbase: Create a syscons-data package
syscons is mostly deprecated and all it's files aren't needed for most
users so create a separate package for them.

Differential Revision:	   https://reviews.freebsd.org/D31798
Reviewed by: emaste
2021-09-07 10:21:40 +02:00
Emmanuel Vadot
88ba5e8955 pkgbase: Create a vt-data package
vt files for either keyboards and fonts are totally optional
so create a separate package for them.

Differential Revision:	     https://reviews.freebsd.org/D31797
2021-09-07 10:21:09 +02: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
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
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
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
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
Andrey V. Elsukov
5c8e8e82ae dtrace: fix ipfw_rule_info_t translator
322e5efda8 has changed field names in the struct ip_fw.
Use correct names in ipfw_rule_info_t translator in the ipfw.d script.

Reported by:	Keith White <kwhite uottawa at gmail>
MFC after:	1 week
2021-09-02 16:35:01 +03:00
Ka Ho Ng
483e3cda0c man: A trailing space cleanup in man9's Makefile
Sponsored by:	The FreeBSD Foundation
2021-09-02 21:04:03 +08:00
Artur Rojek
6d1ef2abd3 ena: Implement full RSS reconfiguration
Bind RX/TX queues and MSI-X vectors to matching CPUs based on the RSS
bucket entries.

Introduce sysctls for the following RSS functionality:
- rss.indir_table:      indirection table mapping
- rss.indir_table_size: indirection table size
- rss.key:              RSS hash key (if Toeplitz used)

Said sysctls are only available when compiled without `option RSS`, as
kernel-side RSS support currently doesn't offer RSS reconfiguration.

Migrate the hash algorithm from CRC32 to Toeplitz and change the initial
hash value to 0x0 in order to match the standard Toeplitz implementation.
Provide helpers for hash key inversion required for HW operations.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2021-09-02 01:06:53 +02:00
Piotr Pawel Stefaniak
0939f965d8 Update a sysctl name to nbuffers_pcpu in hwpmc.4 and pmcstat.c
This change was missed in r333509 (e6b475e0af).

Differential Revision:	https://reviews.freebsd.org/D31704
Reviewed by:	mjg
2021-08-29 21:24:50 +02:00
Dimitry Andric
22b8ab15c4 Remove -simplifycfg-dup-ret from CLANG_OPT_SMALL flags for clang 13
After llvm/clang 13.0.0, the -simplifycfg-dup-ret backend flag is no
longer supported. This was part of CLANG_OPT_SMALL, which is only still
used for stand/i386/boot2 and stand/i386/isoboot, to achieve the very
small binary size required. Luckily clang 13.0.0 does not need any
additional flags for this (I get 240 bytes available when building
boot2).

MFC after:	3 days
2021-08-29 15:39:16 +02:00
Gordon Bergling
b1603638e3 Fix a common typo in man pages and src comments
- s/desciptor/descriptor/

MFC after:	5 days
2021-08-28 19:24:27 +02:00
Ka Ho Ng
6e1df1d14c pmap_extract.9: Fix pmap_extract_and_hold()'s function type
pmap_extract_and_hold() returns a vm_page_t instead of a physical page
address.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	alc
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D31691
2021-08-27 21:44:16 +08:00
Ka Ho Ng
9e202d036d fspacectl(2): Changes on rmsr.r_offset's minimum value returned
rmsr.r_offset now is set to rqsr.r_offset plus the number of bytes
zeroed before hitting the end-of-file. After this change rmsr.r_offset
no longer contains the EOF when the requested operation range is
completely beyond the end-of-file. Instead in such case rmsr.r_offset is
equal to rqsr.r_offset.  Callers can obtain the number of bytes zeroed
by subtracting rqsr.r_offset from rmsr.r_offset.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D31677
2021-08-26 00:03:37 +08:00
Jessica Clarke
83ec48b792 Revert "Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now"
The fixes for this have now been committed so we can re-enable these.

This reverts commit d9f25575a2.

MFC after:	1 week
2021-08-24 15:04:25 +01:00
Jessica Clarke
c8edd05426 clang: Support building with GCC and DEBUG_FILES disabled
If MK_DEBUG_FILES=no then the Clang link rule has clang as .TARGET,
rather than clang.full, causing the implicit ${CFLAGS.${.TARGET:T}} to
be CFLAGS.clang, and thus pull in flags intended for when your compiler
is Clang, not when linking Clang itself. This doesn't matter if your
compiler is in fact Clang, but it breaks using GCC as, for example,
bsd.sys.mk adds -Qunused-arguments to CFLAGS.clang. This is seen when
trying to build a bootstrap toolchain on Linux where GCC is the system
compiler.

Thus, introduce a new internal NO_TARGET_FLAGS variable that is set by
Clang to disable the addition of these implicit flags. This is a bigger
hammer than necessary, as flags for .o files would be safe, but that is
not needed for Clang.

Note that the same problem does not arise for LDFLAGS when building LLD
with BFD, since our build produces a program called ld.lld, not plain
lld (unlike upstream, where ld.lld is a symlink to lld so they can
support multiple different flavours in one binary).

Suggested by:	sjg
Fixes:		31ba4ce889 ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after:	1 week
Reviewed by:	dim, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D31532
2021-08-24 15:04:25 +01:00
Ka Ho Ng
1eaa36523c fspacectl(2): Clarifies the return values
rmacklem@ spotted two things in the system call:
- Upon returning from a successful operation, vop_stddeallocate can
  update rmsr.r_offset to a value greater than file size. This behavior,
  although being harmless, can be confusing.
- The EINVAL return value for rqsr.r_offset + rqsr.r_len > OFF_MAX is
  undocumented.

This commit has the following changes:
- vop_stddeallocate and shm_deallocate to bound the the affected area
  further by the file size.
- The EINVAL case for rqsr.r_offset + rqsr.r_len > OFF_MAX is
  documented.
- The fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9)'s return
  len is explicitly documented the be the value 0, and the return offset
  is restricted to be the smallest of off + len and current file size
  suggested by kib@. This semantic allows callers to interact better
  with potential file size growth after the call.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D31604
2021-08-24 17:08:28 +08:00
Bjoern A. Zeeb
298ee47e19 localedef: unbreak WITHOUT_LOCALES
After 0fa5403d49 ("pkgbase: move locales into their own package") we
need usr.bin/localedef as a bootstrap tool independent on where
WITHOUT_LOCALE was specified as we ALWAYS process C.UTF-8.

At the same time LOCALES= in the local Makefile is empty but
C.UTF-8 with WITHOUT_LOCALES. C.UTF-8 is excluded from FILES, and thus
after the replacement FILES= is set to only .LC_CTYPE which results in
a build failure not knowing how to build that. Tweak the substitution to
replace only non-empty words so that FILES remains harmlessly empty.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D31589
2021-08-19 12:38:17 -05:00
Kristof Provost
a051ca72e2 Introduce m_get3()
Introduce m_get3() which is similar to m_get2(), but can allocate up to
MJUM16BYTES bytes (m_get2() can only allocate up to MJUMPAGESIZE).

This simplifies the bpf improvement in f13da24715.

Suggested by:	glebius
Differential Revision:	https://reviews.freebsd.org/D31455
2021-08-18 08:48:27 +02:00
Piotr Pawel Stefaniak
f49931c142 style.9: remove an outdated comment about indent(1)
indent(1) has had -ncs and -nbs for some time now.
2021-08-17 19:06:24 +02:00
Alex Richardson
d9f25575a2 Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now
I enabled these options again in 31ba4ce889,
but unfortunately only my specific build configuration worked whereas the
build with default options is still broken.
2021-08-17 17:44:52 +01:00
Ed Maste
dff1ba09f7 sysctl.9: put negative sense sysctl note in own paragraph
The sysctl man page cautions against negative-sense boolean sysctls
(foobar_disable), but it gets lost at the end of a large paragraph.
Move it to a separate paragraph in an attempt to make it more clear.

This man page could use a more holistic review and edit pass.  This
change is simple and straightforward and I hope provides a small but
immediate benefit.
2021-08-17 12:10:44 -04:00
Ed Maste
d8aeab4b45 Add gone_in(9) man page
Reviewed by:	imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30703
2021-08-16 17:23:59 -04:00
Vladimir Kondratyev
14a4d6d013 bitstring(3): Add bitstring traversal macros.
The macro bit_foreach() traverses all set bits in the bitstring in the
forward direction, assigning each location in turn to variable.

The macro bit_foreach_at() traverses all set bits in the bitstring in
the forward direction at or after the zero-based bit index, assigning
each location in turn to variable.

The bit_foreach_unset() and bit_foreach_unset_at() macros which
traverses unset bits are implemented for completeness.

Reviewed by:	asomers, dougm
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31469
2021-08-16 23:24:05 +03:00
Kyle Evans
239aebee61 domain: give domains a chance to probe for availability
This gives any given domain a chance to indicate that it's not actually
supported on the current system. If dom_probe isn't supplied, we assume
the domain is universally applicable as most of them are. Keeping
fully-initialized and registered domains around that physically can't
work on a large majority of FreeBSD deployments is sub-optimal and leads
to errors that aren't consistent with the reality of why the socket
can't be created (e.g. ESOCKTNOSUPPORT) because such scenario has to be
caught upon pru_attach, at which point kicking back the more-appropriate
EAFNOSUPPORT would seem weird.

The initial consumer of this will be hvsock, which is only available on
HyperV guests.

Reviewed by:	cem (earlier version), bcr (manpages)
Differential Revision:	https://reviews.freebsd.org/D25062
2021-08-16 00:59:56 -05:00
Mark Johnston
7e14be0b07 pci: Add an ioctl to perform I/O to BARs
This is useful for bhyve, which otherwise has to use /dev/io to handle
accesses to I/O port BARs when PCI passthrough is in use.

Reviewed by:	imp, kib
Discussed with:	jhb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31307
2021-08-14 10:59:03 -04:00
Gordon Bergling
a1581cd735 Fix a common typo in source code comments
- s/aligment/alignment/

MFC after:	5 days
2021-08-14 14:17:48 +02:00
Jessica Clarke
cef65082ae bsd.compiler.mk: Fix cross-building from non-FreeBSD
On non-FreeBSD, the various MACHINE variables for the host when
bootstrapping can be missing or not match FreeBSD's naming, causing
bsd.endian.mk to be unable to infer the endianness. Work around this by
assuming it's unsupported.

Note that we can't check BOOTSTRAPPING here as Makefile.inc1 includes
bsd.compiler.mk before that is set, and so we are unable to catch errors
during buildworld itself when cross-building and bsd.endian.mk failed,
but such errors should also show up when building on FreeBSD.

Fixes:	47363e99d3 ("Enable compressed debug on little-endian targets")
2021-08-12 23:45:09 +01:00
Ka Ho Ng
a638dc4ebc vfs: Add ioflag to VOP_DEALLOCATE(9)
The addition of ioflag allows callers passing
IO_SYNC/IO_DATASYNC/IO_DIRECT down to the file system implementation.
The vop_stddeallocate fallback implementation is updated to pass the
ioflag to the file system implementation. vn_deallocate(9) internally is
also changed to pass ioflag to the VOP_DEALLOCATE call.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D31500
2021-08-12 23:03:49 +08:00
Ka Ho Ng
4a9b832a2a vfs: Rename ioflg to ioflag in vn_deallocate
This includes a style fix around ioflag checking as well.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib, bcr
Differential Revision:	https://reviews.freebsd.org/D31505
2021-08-11 17:45:47 +08:00
Daniel Engberg
4f3a0cfbde Add myself (diizzy) as ports committer
Section 7.1 in Committer's Guide

Reviewed by:	tcberner
Approved by:	tcberner
Differential Revision:	<https://reviews.freebsd.org/D31479>
2021-08-11 09:58:17 +02:00
Mark Johnston
ce2609947c kmsan: Add a manual page
Sponsored by:	The FreeBSD Foundation
2021-08-10 21:27:53 -04:00
Mark Johnston
805c3af898 build.7: Describe the default value for LOCAL_MODULES
Suggested by:	jhb
MFC after:	1 week
2021-08-10 21:18:34 -04:00
Mark Johnston
e7a13643b1 build.7: Document LOCAL_MODULES and LOCAL_MODULES_DIR
Reviewed by:	0mp, imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31461
2021-08-10 11:43:02 -04:00
Piotr Kubaj
8f642f797a share/man/man7/arch.7: bump date 2021-08-10 17:04:51 +02:00
Piotr Kubaj
ecb3f90dd1 share/man/man7/arch.7: powerpc64 support appeared in 9.0-RELEASE
Differential revision:	https://reviews.freebsd.org/D31013
Approved by:	eadler, 0mp
2021-08-10 16:33:29 +02:00
Alan Somers
518e697f2a [skip ci] unix(4): LOCAL_PEERCRED works on SOCK_SEQPACKET, too.
MFC after:	2 weeks
Reviewed By:	dchagin
Differential Revision: https://reviews.freebsd.org/D31456
2021-08-10 07:31:09 -06:00
Konstantin Belousov
4a5a67fe67 ip(4): Mention IP_IPSEC_POLICY ip-level socket option
Text is literally taken from NetBSD ip(4).

Sponsored by:	NVIDIA Networking
MFC after:	3 days
2021-08-10 03:46:49 +03:00
Mark Johnston
e0cc566035 kasan.9: Note the header required for kasan_mark()
Sponsored by:	The FreeBSD Foundation
2021-08-09 13:27:52 -04:00
Ed Maste
47363e99d3 Enable compressed debug on little-endian targets
Compressed debug was enabled by default in commit c910570e75, but
broke the build on big-endian targets, and so was disabled in
89ed2ecb14.

Older versions of LLD fail with big-endian compressed debug sections.
This was fixed in LLD upstream (commit c6ebc651b6fa) and merged to
FreeBSD main (commit d69d07569e) by dim.

External toolchains (e.g. the llvm12 package) will not yet have the fix.
These may be used to link against base system .a archives, so compressed
debug sections would cause trouble even though the base system is fixed.

Enable compressed debug sections again, for little-endian targets only.
As discussed on freebsd-hackers[1] I expect to undo this in the future
(using compressed debug everywhere), once fixed versions of lld are
widely available.

Note that to be pedantically correct we should check both the compiler
and the linker for compressed debug support, but given the external
toolchain constraint the extra complexity does not seem worthwhile.

[1] https://lists.freebsd.org/archives/freebsd-hackers/2021-August/000188.html

PR:		257638
Reported by:	jrtc27 [impact of .a archives]
Discussed with:	imp
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31454

Revert "Disable compressed debug by default"

This reverts commit 89ed2ecb14.
2021-08-08 13:31:28 -04:00
Ed Maste
b0dafb1b6f src.conf.5: Regen after fe52b7f60e, PROFILE default off 2021-08-07 20:51:44 -04:00
Ed Maste
fe52b7f60e Disable PROFILE option by default
Hardware based profiling (e.g. hwpmc) is much better and produces more
useful results.  Today the profiling lib archives (_p.a) serve no real
purpose other than increasing the library build time.

Both upstream and base system (in commit b762974cf4) Clang have been
modified to remove the special case for linking against these libraries.

Clang's -pg support and mcount() remain, so building with -pg can still
be used on code that the user builds; we just no longer provide prebuilt
libraries compiled with -pg.

Discussed on freebsd-hackers[1] / freebsd-current [2] in 2020 and
freebsd-arch [3] in 2021.  A deprecation notice was added in
commit 175841285e.

[1] https://lists.freebsd.org/pipermail/freebsd-hackers/2020-January/055551.html
[2] https://lists.freebsd.org/pipermail/freebsd-current/2020-January/075105.html
[3] https://lists.freebsd.org/archives/freebsd-arch/2021-June/000016.html

PR:		256873 [exp-run]
Reviewed by:	imp, jhb, kib
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30833
2021-08-07 20:24:36 -04:00
Jessica Clarke
5668a155cb gpio.4: Mention new sifive_gpio driver
Suggested by:	mhorne
MFC after:	1 week
2021-08-07 19:31:34 +01:00
Fernando Apesteguía
e6379a2c95 man: Install more man pages unconditionally
Add more manual pages which were not spotted previously in 0a0f748641

Ideally to be MFH'ed with:

8539518055 - Remove manpages from OLD_FILES
8b487b8292 - Fix bsd.subdir.mk-related issues after 0a0f748641
f6043a6721 - ObsoleteFiles.inc: Remove manpages from OLD_FILES
0a0f748641 - man: Build manpages for all architectures

There is at least one pending issue when building with -DNO_ROOT.

Reported by:    ceri@
MFH:    4 weeks
Discussed with: wosch
Differential Revision: https://reviews.freebsd.org/D31018
2021-08-06 18:34:07 +02:00
Greg V
362fef2f4a bsd.cpu.mk: add support for x86-64-v[234] levels as CPUTYPE
These are supported in LLVM 12 and GCC 11:

https://github.com/llvm/llvm-project/commit/012dd42e027e
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=324bec558e95584e8c1997575ae9d75978af59f1

Differential Revision:	https://reviews.freebsd.org/D29150
2021-08-06 09:33:37 -04:00
Emmanuel Vadot
86c71e97d1 pkgbase: locales: Also tag the files dir
Otherwise bsd.dirs.mk will create the directory with the default
package (utilities) and we end up with a bunch of empty dirs managed
by this package while it shouldn't be the case.
2021-08-06 14:37:45 +02:00
Kyle Evans
b3e87f1334 ctypedef: fix installation of C.UTF-8
The appropriate directory and name were assigned to the FILESDIR
grouping, but not the ALWAYS grouping where C.UTF-8 is actually
assigned. Add the appropriate bits for ALWAYSDIR, and remove an
obsolete *PACKAGE= assignment since C.UTF-8 is explicitly not included
in FILES.

Prior to this change, C.UTF-8 was being installed as
/usr/share/C.UTF-8.LC_CTYPE.

Reviewed by:	manu
Fixes:	0fa5403d49 ("pkgbase: move locales into their own package")
Differential Revision:	https://reviews.freebsd.org/D31429
2021-08-05 22:31:40 -05:00