Commit Graph

283156 Commits

Author SHA1 Message Date
Ed Maste
390c31c428 meta.sys.mk: downgrade missing Filemon error to warning
Cirrus-CI was red because `make makeman` failed with a spurious "filemon
is not loaded" error.  For now just make it a warning.
2023-04-23 10:48:22 -04:00
Bjoern A. Zeeb
0e8953b94b LinuxKPI: pci.h: always initialize return value
In pcie_capability_read_*() always initialize the return value to
avoid warnings of uninitialized values in callers.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D39721
2023-04-23 13:29:30 +00:00
Bjoern A. Zeeb
b95fa4203d man4: fix some mandoc lint for iwlwifi.4 and rtw88.4
Address warnings (but one) from mandoc -T lint for these man pages.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-04-23 13:25:24 +00:00
Dimitry Andric
d142601887 powerpc: fix a few pmap related functions to return correct types
While experimenting with changing boolean_t to another type, I noticed
that several powerpc pmap related functions returned the wrong type:
boolean_t instead of int.

Fix several declarations and definitions to match the actual pmap
function types: pmap_dev_direct_mapped_t and pmap_ts_referenced_t.

MFC after:	3 days
2023-04-23 15:23:04 +02:00
Yuri Pankov
336c4682b6 tzsetup: add baseline file to control parsed zonetab contents
Introduce undocumented option -d to dump parsed zonetab file contents
and add a "baseline" target along with instructions on updating it.

Reviewed by:	philip
Differential Revision:	https://reviews.freebsd.org/D39634
2023-04-23 10:32:02 +02:00
Yuri Pankov
f70719fcbd libcasper: remove leftover debug directory
Reviewed by:	mjg
Differential Revision:	https://reviews.freebsd.org/D39756
2023-04-23 09:50:50 +02:00
Simon J. Gerraty
d7e3299f60 Ensure good exit status from type
When looking to see if nproc is available we do
not want warnings about 'type nproc' having bad exit.
2023-04-22 23:15:05 -07:00
Zhenlei Huang
b658c0fce1 ip_mroute: Delete unreachable code
As the flag M_WAITOK is passed to ip_encap_attach(), then the function
will never return NULL, and the following code within NULL check branch
will be unreachable.

No functional change intended.

Reviewed by:	kp
Fixes:		6d8fdfa9d5 Rework IP encapsulation handling code
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39746
2023-04-23 12:47:57 +08:00
Zhenlei Huang
c373e1d6ad if_stf: Delete unreachable code
As the flag M_WAITOK is passed to ip_encap_attach(), then the function
will never return NULL, and the following code within NULL check branch
will be unreachable.

No functional change intended.

Reviewed by:	kp
Fixes:		6d8fdfa9d5 Rework IP encapsulation handling code
MFC after:	1 week
Differential Revision:  https://reviews.freebsd.org/D39746
2023-04-23 12:47:57 +08:00
Simon J. Gerraty
04989ef426 bmake 20230123 gives us .SYSPATH
No need to faff about trying to work out where bmake
is looking - it tells you.
2023-04-22 18:15:31 -07:00
Colin Percival
df53ae0fdd Remove portsnap(8)
Rather than having a tool in the FreeBSD base system for obtaining
the FreeBSD ports tree, users are encouraged to `pkg install git`
and then `git clone https://git.FreeBSD.org/ports.git /usr/ports`.

The portsnap servers will continue operating until FreeBSD 13 reaches
its End-of-Life, and portsnap is available from the ports tree as
ports-mgmt/portsnap.

Requested by:	portmgr
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D39563
X-MFC:		no
2023-04-22 18:12:37 -07:00
Simon J. Gerraty
fb30bb0d4d dirdeps.mk ensure M_dep_qual_fixes is applied 2023-04-22 18:00:45 -07:00
Simon J. Gerraty
3483454556 local.meta.sys.mk skip OBJTOP for host
It was already done by local.meta.sys.env.mk
2023-04-22 17:59:12 -07:00
Dmitry Chagin
66e8f1f7d3 linux(4): Fix arm64 build after b7a6bcdd, missed chunk added
MFC after:		1 month
2023-04-23 01:41:12 +03:00
Simon J. Gerraty
cf20b1f81c Extract some of local.meta.sys.mk to local.meta.sys.env.mk
Latest meta.sys.mk follows sys.mk in including local.meta.sys.env.mk
and local.meta.sys.mk late, but we have things we need done early
so move them to local.meta.sys.env.mk
2023-04-22 15:07:53 -07:00
Simon J. Gerraty
16161b4839 makeman export UPDATE_DEPENFILE=no
Just to be clear we do not need any updates.
2023-04-22 14:57:24 -07:00
Simon J. Gerraty
188bf8876f Build host tools on non-FreeBSD host with DIRDEPS_BUILD
Add Makefile.depend.options to libnetbsd, mkimg and makefs
to ensure libegacy is build if needed.

targets/pseudo/stage/Makefile avoid the need for mtree
the staging process creates target dirs as needed anyway.

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39757
2023-04-22 13:13:22 -07:00
Simon J. Gerraty
db98bc2c0d Allow tools/build to work for DIRDEPS_BUILD
We want to be able to build some host tools for non-FreeBSD hosts
without building more than we need.  The DIRDEPS_BUILD lets us
do that.

We use the pseudo MACHINE "host" when building
for the host - deal with that when setting _host_arch.

Reviewed by:	jrtc27
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39751
2023-04-22 12:25:54 -07:00
Dmitry Chagin
0ef30b5d6b linux(4): Bump osrelease to 5.15.0
Linux kernel version 5.15 named Trick or Treat is a 22nd LTS release.

Reviewed by:		trasz, emaste
Differential Revision:	https://reviews.freebsd.org/D39649
MFC after:		1 month
2023-04-22 22:18:08 +03:00
Dmitry Chagin
b7a6bcdd13 linux(4): Export the AT_MINSIGSTKSZ depending on the process osreldata
AT_MINSIGSTKSZ has appeared in the 5.13.0 Linux kernel first time.

Differential Revision:	https://reviews.freebsd.org/D39648
MFC after:		1 month
2023-04-22 22:17:52 +03:00
Dmitry Chagin
70eab81d6f linux(4): Export the AT_EXECFN depending on the process osreldata
AT_EXECFN has appeared in the 2.6.26 Linux kernel first time.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D39647
MFC after:		1 month
2023-04-22 22:17:36 +03:00
Dmitry Chagin
40c36c4674 linux(4): Export the AT_RANDOM depending on the process osreldata
AT_RANDOM has appeared in the 2.6.30 Linux kernel first time.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D39646
MFC after:		1 month
2023-04-22 22:17:17 +03:00
Dmitry Chagin
56c5230afd linux(4): Fix LINUX_AT_COUNT comments
Differential Revision:	https://reviews.freebsd.org/D39645
MFC after:		1 month
2023-04-22 22:16:43 +03:00
Dmitry Chagin
7d8c983983 linux(4): Deduplicate linux_copyout_auxargs()
Export default MINSIGSTKSZ value for the x86 until we do not preserve AVX
registers in the signal context.

Differential Revision:	https://reviews.freebsd.org/D39644
MFC after:		1 month
2023-04-22 22:16:02 +03:00
Simon J. Gerraty
8561d0b2ec Simplify building host tools during DIRDEPS_BUILD
The whole point of the DIRDEPS_BUILD is to avoid tree walks
and basically build everything in a single pass.
We use the pseudo MACHINE "host" to represent the build host.

When the build host is not FreeBSD or is an older version of FreeBSD
it may need some help to build host-tools.

The directory tools/build does this - building libegacy.

local.sys.mk: create a pseudo option MK_host_egacy to indicate
if tools/build needs to be built for "host".

local.dirdeps.mk: set MK_host_egacy.host to ${MK_host_egacy}
all other DEP_MACHINES will get "no"

This allows a Makefile.depend.options in makefs etc to cause tools/build
to be built for host but only if necessary.

local.init.mk: use ISYSTEM as arg to -isystem so that it can be overridden.
The default remains ${STAGE_INCLUDEDIR}

src.init.mk: if MACHINE is host and we are not FreeBSD
set some MK_ flags the same as tools/build/mk/Makefile.boot.pre and
include src.init.${.MAKE.OS:tl}.mk if it exists.

For older versions of FreeBSD add libegacy when building PROGs for "host"

Also instead of -isystem${STAGE_INCLUDEDIR} we want
-I${STAGE_INCLUDEDIR} and -isystem/usr/include so we override ISYSTEM.
This means any headers we stage for "host" will take precedence over
system headers but #include_next will DTRT.

src.init.linux.mk: add
-I${SRCTOP}/tools/build/cross-build/include/linux
and generally deal with building host tools on Linux.
Eg. static linking does not work so set NO_SHARED= no
Override some HAVE_ flags.

src.sys.env.mk: on linux awk throws an warning about # in newvers.sh
just send stderr to /dev/null

Reviewed by:	jrtc27, arichardson
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39744
2023-04-22 12:01:49 -07:00
Kristof Provost
dbce131b8f pfctl: match geticmpcodeby*()/print_fromto() prototypes to definitions
The definitions use sa_family_t, not u_int8_t.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-22 19:43:56 +02:00
Kristof Provost
5e3bb05147 pfctl: remove unneeded includes
We don't use nvlists (directly) or sysctls, so there's no need to
include the headers.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-22 19:43:55 +02:00
Justin Hibbits
0468e89cb3 zfs/powerpc64: Fix big-endian powerpc64 asm
The powerpc asm from openzfs assumes that big-endian is always ELFv1 and
ELFv2 is always little-endian, while FreeBSD uses ELFv2 everywhere.  Add
the necessary bits to the checksum asm to work on big-endian ELFv2.

This was also submitted upstream as PR#14779.

Tested by:	dbaio
2023-04-22 11:27:49 -04:00
Rick Macklem
33906122e1 nfsuserd.c: Replace slave with server 2023-04-22 08:18:02 -07:00
Peter Holm
7f658f99f7 stress2: Mark set but unused variables as unused 2023-04-22 13:16:01 +02:00
Vladimir Kondratyev
06c844e175 LinuxKPI: Fix building on 32bit archs
Reported by:	Jenkins
Fixes:	e5cf9deb61 ("LinuxKPI: Add bitmap_to_arr32() to <linux/bitmap.h>")
2023-04-22 13:25:49 +03:00
Vladimir Kondratyev
af22da75a0 Bump __FreeBSD_version after LinuxKPI updates 2023-04-22 11:29:29 +03:00
Vladimir Kondratyev
53d821d651 LinuxKPI: Define noinline_for_stack compiler attribute
It is identical to noinline and used for documentation reasons.

Required by:	drm-kmod 5.15-lts
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D39553
2023-04-22 11:29:29 +03:00
Vladimir Kondratyev
e5cf9deb61 LinuxKPI: Add bitmap_to_arr32() to <linux/bitmap.h>
bitmap_to_arr32() copies contents of bitmap to a uint32_t array of bits

Required by:	drm-kmod 5.15-lts
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D39552
2023-04-22 11:29:29 +03:00
Vladimir Kondratyev
b14c03f808 LinuxKPI: define acpi_put_table() in <acpi/acpi.h>
FreeBSD ACPICA calls it AcpiPutTable()

Required by:	drm-kmod 5.15-lts
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D39551
2023-04-22 11:29:29 +03:00
Warner Losh
16e9ec4406 stand: mark unused argment as unused
We don't use the 'ver' argument for uuids sometimes, so mark it unused.

Sponsored by:		Netflix
2023-04-22 00:30:43 -06:00
Cameron Katri
81fa5c4a82 llvm-strings: Install as strings when WITH_LLVM_BINUTILS=YES
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D32065
2023-04-21 16:13:40 -04:00
Ed Maste
5d3e7166f6 libcbor: update to 0.10.2
Sponsored by:	The FreeBSD Foundation
2023-04-21 16:10:03 -04:00
Ed Maste
41df1d60e3 llvm: fix some llvm-* tool links when WITH_LLVM_BINUTILS is set
A few Makefiles overrode LINKS and MLINKS when WITH_LLVM_BINUTILS was
set, which caused some llvm- prefixed tools to disappear.  One such case
was llvm-ranlib, which some ports invoke explicitly.

Use += when adding to LINKS and MLINKS under WITH_LLVM_BINUTILS.

PR:		270955, 270956, 270959
Submitted by:	jbeich
Reviewed by:	arichardson
Fixes: 021385aba5 ("Add WITH_LLVM_BINUTILS to install LLVM binuti...")
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39747
2023-04-21 12:49:05 -04:00
Warner Losh
7b42f338d7 freebsd32: Regen
Need to regen freebsd32 as well when sys/kern/syscalls.master is
updated.

Sponsored by:		Netflix
2023-04-21 10:25:10 -06:00
Warner Losh
e63690e885 truss: Kill dead code
If it doesn't exist, we don't need it in the table...

Sponsored by:		Netflix
2023-04-21 10:24:26 -06:00
Warner Losh
2c19beeed2 newvers: Use correct regexp
There's no need to quote the # here. Inside of regexp, it's not treated
like a comment from an awk perspective. And inside if '' it's not
treated as special by the shell. gawk also warns.

Sponsored by:		Netflix
2023-04-21 10:24:25 -06:00
Mark Johnston
92fa22c6a5 riscv: Compile instr_size.c into the kernel when DTrace is configured
Reported by:	Jenkins
Fixes:	080e56a6c9 ("dtrace: expose dtrace_instr_size() to userland and implement it for riscv")
2023-04-21 09:26:17 -04:00
Randall Stewart
01216268f8 tcp: hpts needs to still call output even after input.
The other stacks it turns out actually expect the output to be called and can become stuck if it is
not. This is because they run there timer code from there and the input routine does not always
assure a timer is running. The real longterm fix here might be to go into the other stacks (rack and bbr)
and make sure that a timer is running after input if you don't do output.. as well as call the timer functions.
This would cut down on calls from hpts. But I think its too dramatic of a change for the immediate time.

Reviewed by: tuexen, glebius
Sponsored by: Netflix Inc
Differential Revision:https://reviews.freebsd.org/D39738
2023-04-21 07:12:25 -04:00
Kristof Provost
4bfffd8cf5 pf.conf.5: minor improvements
* Align 'on <interface>' parameter with the BNF, so use 'on <ifspec>'
* Clarify etherprotospec BNF, to make it clearer that only numbers are
  supported.

Suggested by:	Christian McDonald
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-21 10:08:02 +02:00
Mariusz Zaborski
444c661545 mpr: don't use hardcoded value in debug branch
Pointed out by:	imp
Sponsored by:   Klara Inc.
2023-04-21 10:01:38 +02:00
Mariusz Zaborski
ea6597c38c mpr: fix copying of event_mask
Before the commit 6cc44223cb the
field event_mask was fully copied to the EventMasks field.
After this commit the event_mask (uint8_t) is 4 times casted to
EventMask (uint32_t). Because of that 24 bits of each event_mask array
is lost.

This commits brings back simple copying of field, and after words
converting 32 bits field to the requested endian.

I don't think we need more sophisticated method,
as the array is of size 4 (for 32 bits version).

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D39562
2023-04-21 10:01:38 +02:00
Austin Shafer
3f686532c9 linuxkpi: Fix __sg_alloc_table_from_pages loop
Commit 3e0856b63f updated
__sg_alloc_table_from_pages to use the same API as linux, but modified
the loop condition when going over the pages in a sg list. Part of the
change included moving the sg_next call out of the for loop and into the
body, which causes an off by one error when traversing the list. Since
sg_next is called before the loop body it will skip the first element
and read one past the last element.

This caused panics when running PRIME with nvidia-drm as the off-by-one
issue causes a NULL dereference.

Reviewed by:	bz, hselasky
Differential Revision:	https://reviews.freebsd.org/D39628
Fixes:	3e0856b63f ("linuxkpi: Fix `sg_alloc_table_from_pages()` to have the same API as Linux")
2023-04-21 09:56:50 +02:00
Warner Losh
9abba78acc syscalls: regenerate
The 4.2 sigreturn was a bit of a enima so the 4.2 was remove. Regenerate
to cope the very minor changes in comments and one string.

Sponsored by:		Netflix
2023-04-20 23:39:23 -06:00
Warner Losh
602b575a88 syscall.master: Remove stray 4.2
Back in 4.3BSD, the system call table wasn't generated, and there was an
entry:
        "4.2 sigreturn",        /* 139 = old 4.2 sigreturn */
This got converted to
139     OBSOL   0 4.2 sigreturn
in 4.3 RENO. Since it was obsolete, nothing bad happened. In fact,
there was code in makeyscalls.sh to cope:
        {       comment = $4
                for (i = 5; i <= NF; i++)
                        comment = comment " " $i
                if (NF < 5)
                        $5 = $4
        }
so the generated comment in syscalls.c was almost correct:
        "obs_4.2",                      /* 139 = obsolete 4.2 sigreturn */
a bug that we have to this very day, despite makesyscalls.sh being
rewritten in lua.

However, this historical wart is the only place in our current
syscalls.master file where we have an extra field for the 'not
generated' class of system calls. Remove the historical wart so that the
re-write of makesyscalls.lua can be simpler (so, I hope, qemu's bsd-user
can large swathes of code automatically generated too). This should help
make things more understandable (changes to simplify makesyscalls.lue
aren't quite debugged, so have to wait for another day).

There's 3 different obsolete sigreturns (but only 1 that was ever in
FreeBSD 2.x and newer).

Sponsored by:		Netflix
2023-04-20 23:39:23 -06:00