]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 months agoRemove unneeded masks from the arm64 KASAN shadow
Andrew Turner [Fri, 21 Apr 2023 15:28:36 +0000 (16:28 +0100)]
Remove unneeded masks from the arm64 KASAN shadow

When mapping the arm64 KASAN shadow map we use Ln_TABLE_MASK to align
physical addresses, however these should already be aligned either
by rounding to a greater alignment, or the VM subsystem is giving us
a correctly aligned page.

Remove these extra alignment masks.

Reviewed by: kevans
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D39752

16 months agohid: fix typo in hid_is_collection
Hu Shunchao [Mon, 24 Apr 2023 11:17:51 +0000 (14:17 +0300)]
hid: fix typo in hid_is_collection

hid_input is equal to 0. It is leftover from NetBSD code.

Reviewed by: hselasky, wulf
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D28149

16 months agobcm5974: fix wellspring9 pressure settings to handle force sensitivity
Val Packett [Mon, 24 Apr 2023 09:41:52 +0000 (12:41 +0300)]
bcm5974: fix wellspring9 pressure settings to handle force sensitivity

Reviewed by: wulf
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D34435

16 months agointelspi: add PCI attachment (Lynx/Wildcat/Sunrise Point)
Val Packett [Mon, 24 Apr 2023 09:41:52 +0000 (12:41 +0300)]
intelspi: add PCI attachment (Lynx/Wildcat/Sunrise Point)

Also adds fixups and cleanups:

- apply the child's mode/speed
- implement suspend/resume support
- use RF_SHAREABLE interrupts
- use bus_delayed_attach_children since the transfer can use interrupts
- add support for newly added spibus features (cs_delay and flags)

Operation tested on Broadwell (Wildcat Point) MacBookPro12,1.
Attachment also tested on Kaby Lake (Sunrise Point) Pixelbook.

Reviewed by: wulf
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D29249

16 months agospibus: extend API: add cs_delay ivar, KEEP_CS and NO_SLEEP flags
Val Packett [Mon, 24 Apr 2023 09:41:52 +0000 (12:41 +0300)]
spibus: extend API: add cs_delay ivar, KEEP_CS and NO_SLEEP flags

These feature are required for an upcoming Apple MacBook topcase
(HID over SPI) driver:

A delay after toggling CS is required to avoid anomalies like an extra
junk byte in front of the message. Keeping CS asserted is required to
be able to read a status report after writing a command. (The device
won't return the status if CS was deasserted.)

Sleep is not allowed in the interrupt context where the Apple input
driver runs its transactions. Use a flag to tell the SPI driver to
avoid mtx_sleep.

Reviewed by: manu (ok to SPI part of larger patch)
MFC afret: 1 month
Differential revision: https://reviews.freebsd.org/D29534

16 months agoext2fs: extract crc16 into sys/crc16.h
Val Packett [Mon, 24 Apr 2023 09:41:52 +0000 (12:41 +0300)]
ext2fs: extract crc16 into sys/crc16.h

deduplicate this as it might be needed for other drivers (e.g. Apple SPI-HID)

Sponsored by: https://www.patreon.com/valpackett
Reviewed by: chuck, imp
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D32879

16 months agoshowconfig - ignore options that do not start with A-Z
Simon J. Gerraty [Sun, 23 Apr 2023 23:52:12 +0000 (16:52 -0700)]
showconfig - ignore options that do not start with A-Z

When building on various hosts it can be handy to create pseudo
options like MK_host_egacy - building on a host that needs libegacy.

Such options should be ignored by showconfig

Reviewed by: emaste

16 months agoposixshmcontrol(1): silently ignore inaccessible segments when listing
Konstantin Belousov [Sun, 23 Apr 2023 23:30:58 +0000 (02:30 +0300)]
posixshmcontrol(1): silently ignore inaccessible segments when listing

PR: 271038
Reported by: rau8344@gmail.com
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

16 months agoath10k: add man page
Bjoern A. Zeeb [Sun, 23 Apr 2023 21:22:01 +0000 (21:22 +0000)]
ath10k: add man page

Add initial man page for ath10k.4.

MFC after: 2 months

16 months agoath10k: import ath10k driver
Bjoern A. Zeeb [Wed, 19 Apr 2023 13:16:17 +0000 (13:16 +0000)]
ath10k: import ath10k driver

Import ISC-licensed ath10k driver assumed to be
based on Linux kvalo/ath.git master at
6bae9de622d3ef4805aba40e763eb4b0975c4f6d.

Import support to redirect fwlogs to kernel messages
from https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/389075

Complement the driver to make compile on FreeBSD
using LinuxKPI with changes covered by #ifdef (__FreeBSD__).
Further select updates were applied since the initial import
in order to keep compiling along with other LinuxKPI based
drivers.

Any other native driver using BUS_PROBE_DEFAULT will attach
ignoring this one by default given bsd_probe_return is set
to a lower priority.

Add the module build framework.

We only support PCI parts.

The firmware is provided by port net/wifi-firmware-ath10k-kmod.

Given the lack of full license texts on most files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Approved by: core (emaste, 2022-04-08) [1]
MFC after: 2 months

16 months agoathk: import common code for ath1?k drivers
Bjoern A. Zeeb [Wed, 19 Apr 2023 12:48:08 +0000 (12:48 +0000)]
athk: import common code for ath1?k drivers

Import common ISC-licensed athk parts assumed to be
based on Linux kvalo/ath.git master at
6bae9de622d3ef4805aba40e763eb4b0975c4f6d.

The only modification should be for FreeBSD module
handling in main.c.

Add the module build framework unconnected to the
build for now.

These files will be shared by ath1?k drivers.

MFC after: 2 months

16 months agoath10k: ath11k: add specific LinuxKPI support
Bjoern A. Zeeb [Tue, 18 Apr 2023 20:21:37 +0000 (20:21 +0000)]
ath10k: ath11k: add specific LinuxKPI support

Add files needed by ath1?k drivers to linuxkpi/linuxkpi_wlan.
This contain (skeleton) implementations of what is needed to
compile but specifically mhi/qmi/qrtr will need more work for
ath11k.

MFC after: 2 months

16 months agoath10k: ath11k: ammend devd.conf regex
Bjoern A. Zeeb [Tue, 18 Apr 2023 20:13:24 +0000 (20:13 +0000)]
ath10k: ath11k: ammend devd.conf regex

In order to match these drivers, and in expectiation of ath12k
happening add ath[0-9]+k to the regex pattern for wlan devices.

MFC after: 2 months

16 months agomt76: devd: add support for mt79* wireless drivers to devd.conf
Bjoern A. Zeeb [Tue, 18 Apr 2023 14:31:41 +0000 (14:31 +0000)]
mt76: devd: add support for mt79* wireless drivers to devd.conf

Add the "mt79" to the regex for wireless drivers in devd.conf so
that they get handled as expected.

MFC after: 2 months

16 months agomt76: add module build framework and man pages
Bjoern A. Zeeb [Tue, 18 Apr 2023 14:30:20 +0000 (14:30 +0000)]
mt76: add module build framework and man pages

Add framework to build if_mt7915 and if_mt7921 with LinuxKPI
as well as initial man pages for the two mt76 chipset drivers.

MFC after: 2 months

16 months agomt76: import mediatek/mt76 driver
Bjoern A. Zeeb [Tue, 18 Apr 2023 14:26:38 +0000 (14:26 +0000)]
mt76: import mediatek/mt76 driver

Import ISC-licensed driver parts of mediatek/mt76
assumed to be based on Linux wireless-testing at
a02411a5b98612c12be99349836d99f07db12a77 (tag: wt-2022-11-23).

Complement the driver and LinuxKPI with our own (dummy)
implementations of missing parts (util.h and soc/mediatek/)
as well as changes to make compile on FreeBSD with changes
covered by #ifdef (__FreeBSD__) conditions.
Further select updates were applied since the initial import
in order to keep compiling along with other LinuxKPI based
drivers.

For the moment we only target the mt7915 and mt7921 PCI parts.
More may follow in the future.

Firmware is provided by port net/wifi-firmware-mt76-kmod.

Given the lack of full license texts on non-local files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Approved by: core (emaste, 2022-04-08) [1]
MFC after: 2 months

16 months agoSet UPDATE_DEPDFILE=NO for showconfig
Simon J. Gerraty [Sun, 23 Apr 2023 20:43:45 +0000 (13:43 -0700)]
Set UPDATE_DEPDFILE=NO for showconfig

Exporting UPDATE_DEPDFILE=NO from makeman didn't work,
back to setting it in local.meta.sys.env.mk

16 months agokcsan: add __tsan_mem(cpy|move|set) aliases for clang >= 16
Dimitry Andric [Sun, 23 Apr 2023 18:11:34 +0000 (20:11 +0200)]
kcsan: add __tsan_mem(cpy|move|set) aliases for clang >= 16

Summary:
After https://github.com/llvm/llvm-project/commit/b4257d3bf58c ("[tsan]
Replace mem intrinsics with calls to interceptors") intrinsic calls to
memcpy, memmove or memset will directly call sanitizer interceptors,
e.g. __tsan_memcpy, __tsan_memmove or __tsan_memset.

Building GENERIC-KCSAN with clang >= 16 would thus result in link errors
similar to:

  ld: error: undefined symbol: __tsan_memcpy
  >>> referenced by cam_compat.c:150 (/usr/src/sys/cam/cam_compat.c:150)
  >>>               cam_compat.o:(cam_compat_handle_0x17)
  >>> referenced by cam_compat.c:151 (/usr/src/sys/cam/cam_compat.c:151)
  >>>               cam_compat.o:(cam_compat_handle_0x17)
  >>> referenced by cam_compat.c:152 (/usr/src/sys/cam/cam_compat.c:152)
  >>>               cam_compat.o:(cam_compat_handle_0x17)
  >>> referenced 1692 more times

Similar to subr_msan.c, add aliases from the existing kcsan_* versions
of these functions to __tsan_* names.

Reviewed by: markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39772

16 months agoarm64: Disable PAC when booting on a Windows Dev Kit 2023
Mark Johnston [Sun, 23 Apr 2023 17:32:45 +0000 (13:32 -0400)]
arm64: Disable PAC when booting on a Windows Dev Kit 2023

It appears that PAC registers are configured to trap upon access, but
since the kernel starts in EL1 on this platform it has no ability to
inspect or modify this configuration.  Simply disable PAC on this
platform for now, since the kernel otherwise hangs during boot.

PR: 270472
Reviewed by: andrew, emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D39748

16 months agoriscv: Implement bus_describe_intr() for nexus
Mark Johnston [Sun, 23 Apr 2023 17:31:01 +0000 (13:31 -0400)]
riscv: Implement bus_describe_intr() for nexus

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39750

16 months agoarm64: Implement bus_describe_intr() for nexus
Mark Johnston [Sun, 23 Apr 2023 17:30:44 +0000 (13:30 -0400)]
arm64: Implement bus_describe_intr() for nexus

Prompted by a compiler warning introduced by
e582d4a2b09e ("arm64: nexus code tidy-up").

Reviewed by: mhorne, andrew
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39749

16 months agoinpcb: Fix some bugs in _in_pcbinshash_wild()
Mark Johnston [Sun, 23 Apr 2023 14:36:24 +0000 (10:36 -0400)]
inpcb: Fix some bugs in _in_pcbinshash_wild()

- In _in_pcbinshash_wild(), we should avoid returning v6 sockets unless
  no other matches are available.  This preserves pre-existing
  semantics.
- Fix an inverted test: when inserting a non-jailed PCB, we want to
  search for the first non-jailed PCB in the hash chain.
- Test the right PCB when searching for a non-jailed PCB.

While here, add a required locking assertion.

Fixes: 7b92493ab1d4 ("inpcb: Avoid inp_cred dereferences in SMR-protected lookup")

16 months agosctp: use constants from RFC 8260 to improve compliance
Michael Tuexen [Sun, 23 Apr 2023 15:48:05 +0000 (17:48 +0200)]
sctp: use constants from RFC 8260 to improve compliance

Keep the old constants for backwards compatibility.

MFC after: 1 week

16 months agometa.sys.mk: downgrade missing Filemon error to warning
Ed Maste [Sun, 23 Apr 2023 14:48:22 +0000 (10:48 -0400)]
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.

16 months agoLinuxKPI: pci.h: always initialize return value
Bjoern A. Zeeb [Thu, 20 Apr 2023 15:59:33 +0000 (15:59 +0000)]
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

16 months agoman4: fix some mandoc lint for iwlwifi.4 and rtw88.4
Bjoern A. Zeeb [Sun, 23 Apr 2023 13:21:46 +0000 (13:21 +0000)]
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

16 months agopowerpc: fix a few pmap related functions to return correct types
Dimitry Andric [Sun, 23 Apr 2023 13:22:44 +0000 (15:22 +0200)]
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

16 months agotzsetup: add baseline file to control parsed zonetab contents
Yuri Pankov [Sun, 23 Apr 2023 08:31:53 +0000 (10:31 +0200)]
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

16 months agolibcasper: remove leftover debug directory
Yuri Pankov [Sun, 23 Apr 2023 07:49:49 +0000 (09:49 +0200)]
libcasper: remove leftover debug directory

Reviewed by: mjg
Differential Revision: https://reviews.freebsd.org/D39756

16 months agoEnsure good exit status from type
Simon J. Gerraty [Sun, 23 Apr 2023 06:15:05 +0000 (23:15 -0700)]
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.

16 months agoip_mroute: Delete unreachable code
Zhenlei Huang [Sun, 23 Apr 2023 04:47:57 +0000 (12:47 +0800)]
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: 6d8fdfa9d5e7d Rework IP encapsulation handling code
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39746

16 months agoif_stf: Delete unreachable code
Zhenlei Huang [Sun, 23 Apr 2023 04:47:57 +0000 (12:47 +0800)]
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: 6d8fdfa9d5e7d Rework IP encapsulation handling code
MFC after: 1 week
Differential Revision:  https://reviews.freebsd.org/D39746

16 months agobmake 20230123 gives us .SYSPATH
Simon J. Gerraty [Sun, 23 Apr 2023 01:15:31 +0000 (18:15 -0700)]
bmake 20230123 gives us .SYSPATH

No need to faff about trying to work out where bmake
is looking - it tells you.

16 months agoRemove portsnap(8)
Colin Percival [Sun, 23 Apr 2023 01:07:14 +0000 (18:07 -0700)]
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

16 months agodirdeps.mk ensure M_dep_qual_fixes is applied
Simon J. Gerraty [Sun, 23 Apr 2023 01:00:45 +0000 (18:00 -0700)]
dirdeps.mk ensure M_dep_qual_fixes is applied

16 months agolocal.meta.sys.mk skip OBJTOP for host
Simon J. Gerraty [Sun, 23 Apr 2023 00:59:12 +0000 (17:59 -0700)]
local.meta.sys.mk skip OBJTOP for host

It was already done by local.meta.sys.env.mk

16 months agolinux(4): Fix arm64 build after b7a6bcdd, missed chunk added
Dmitry Chagin [Sat, 22 Apr 2023 22:41:12 +0000 (01:41 +0300)]
linux(4): Fix arm64 build after b7a6bcdd, missed chunk added

MFC after: 1 month

16 months agoExtract some of local.meta.sys.mk to local.meta.sys.env.mk
Simon J. Gerraty [Sat, 22 Apr 2023 22:07:53 +0000 (15:07 -0700)]
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

16 months agomakeman export UPDATE_DEPENFILE=no
Simon J. Gerraty [Sat, 22 Apr 2023 21:57:24 +0000 (14:57 -0700)]
makeman export UPDATE_DEPENFILE=no

Just to be clear we do not need any updates.

16 months agoBuild host tools on non-FreeBSD host with DIRDEPS_BUILD
Simon J. Gerraty [Sat, 22 Apr 2023 20:13:22 +0000 (13:13 -0700)]
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

16 months agoAllow tools/build to work for DIRDEPS_BUILD
Simon J. Gerraty [Sat, 22 Apr 2023 19:25:54 +0000 (12:25 -0700)]
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

16 months agolinux(4): Bump osrelease to 5.15.0
Dmitry Chagin [Sat, 22 Apr 2023 19:18:08 +0000 (22:18 +0300)]
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

16 months agolinux(4): Export the AT_MINSIGSTKSZ depending on the process osreldata
Dmitry Chagin [Sat, 22 Apr 2023 19:17:52 +0000 (22:17 +0300)]
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

16 months agolinux(4): Export the AT_EXECFN depending on the process osreldata
Dmitry Chagin [Sat, 22 Apr 2023 19:17:36 +0000 (22:17 +0300)]
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

16 months agolinux(4): Export the AT_RANDOM depending on the process osreldata
Dmitry Chagin [Sat, 22 Apr 2023 19:17:17 +0000 (22:17 +0300)]
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

16 months agolinux(4): Fix LINUX_AT_COUNT comments
Dmitry Chagin [Sat, 22 Apr 2023 19:16:43 +0000 (22:16 +0300)]
linux(4): Fix LINUX_AT_COUNT comments

Differential Revision: https://reviews.freebsd.org/D39645
MFC after: 1 month

16 months agolinux(4): Deduplicate linux_copyout_auxargs()
Dmitry Chagin [Sat, 22 Apr 2023 19:16:02 +0000 (22:16 +0300)]
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

16 months agoSimplify building host tools during DIRDEPS_BUILD
Simon J. Gerraty [Sat, 22 Apr 2023 19:01:49 +0000 (12:01 -0700)]
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

16 months agopfctl: match geticmpcodeby*()/print_fromto() prototypes to definitions
Kristof Provost [Fri, 21 Apr 2023 13:13:19 +0000 (15:13 +0200)]
pfctl: match geticmpcodeby*()/print_fromto() prototypes to definitions

The definitions use sa_family_t, not u_int8_t.

Sponsored by: Rubicon Communications, LLC ("Netgate")

16 months agopfctl: remove unneeded includes
Kristof Provost [Fri, 21 Apr 2023 09:31:44 +0000 (11:31 +0200)]
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")

16 months agozfs/powerpc64: Fix big-endian powerpc64 asm
Justin Hibbits [Thu, 13 Apr 2023 15:26:52 +0000 (11:26 -0400)]
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

16 months agonfsuserd.c: Replace slave with server
Rick Macklem [Sat, 22 Apr 2023 15:18:02 +0000 (08:18 -0700)]
nfsuserd.c: Replace slave with server

16 months agostress2: Mark set but unused variables as unused
Peter Holm [Sat, 22 Apr 2023 11:16:01 +0000 (13:16 +0200)]
stress2: Mark set but unused variables as unused

16 months agoLinuxKPI: Fix building on 32bit archs
Vladimir Kondratyev [Sat, 22 Apr 2023 10:24:40 +0000 (13:24 +0300)]
LinuxKPI: Fix building on 32bit archs

Reported by: Jenkins
Fixes: e5cf9deb61fd ("LinuxKPI: Add bitmap_to_arr32() to <linux/bitmap.h>")

16 months agoBump __FreeBSD_version after LinuxKPI updates
Vladimir Kondratyev [Sat, 22 Apr 2023 08:29:29 +0000 (11:29 +0300)]
Bump __FreeBSD_version after LinuxKPI updates

16 months agoLinuxKPI: Define noinline_for_stack compiler attribute
Vladimir Kondratyev [Sat, 22 Apr 2023 08:29:29 +0000 (11:29 +0300)]
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

16 months agoLinuxKPI: Add bitmap_to_arr32() to <linux/bitmap.h>
Vladimir Kondratyev [Sat, 22 Apr 2023 08:29:29 +0000 (11:29 +0300)]
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

16 months agoLinuxKPI: define acpi_put_table() in <acpi/acpi.h>
Vladimir Kondratyev [Sat, 22 Apr 2023 08:29:29 +0000 (11:29 +0300)]
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

16 months agostand: mark unused argment as unused
Warner Losh [Sat, 22 Apr 2023 06:29:03 +0000 (00:29 -0600)]
stand: mark unused argment as unused

We don't use the 'ver' argument for uuids sometimes, so mark it unused.

Sponsored by: Netflix

16 months agollvm-strings: Install as strings when WITH_LLVM_BINUTILS=YES
Cameron Katri [Wed, 5 Apr 2023 19:53:33 +0000 (15:53 -0400)]
llvm-strings: Install as strings when WITH_LLVM_BINUTILS=YES

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D32065

16 months agolibcbor: update to 0.10.2
Ed Maste [Fri, 21 Apr 2023 20:09:03 +0000 (16:09 -0400)]
libcbor: update to 0.10.2

Sponsored by: The FreeBSD Foundation

16 months agollvm: fix some llvm-* tool links when WITH_LLVM_BINUTILS is set
Ed Maste [Fri, 21 Apr 2023 13:11:45 +0000 (09:11 -0400)]
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: 021385aba562 ("Add WITH_LLVM_BINUTILS to install LLVM binuti...")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39747

16 months agofreebsd32: Regen
Warner Losh [Fri, 21 Apr 2023 16:25:10 +0000 (10:25 -0600)]
freebsd32: Regen

Need to regen freebsd32 as well when sys/kern/syscalls.master is
updated.

Sponsored by: Netflix

16 months agotruss: Kill dead code
Warner Losh [Fri, 21 Apr 2023 16:21:40 +0000 (10:21 -0600)]
truss: Kill dead code

If it doesn't exist, we don't need it in the table...

Sponsored by: Netflix

16 months agonewvers: Use correct regexp
Warner Losh [Fri, 21 Apr 2023 16:14:41 +0000 (10:14 -0600)]
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

16 months agoriscv: Compile instr_size.c into the kernel when DTrace is configured
Mark Johnston [Fri, 21 Apr 2023 13:26:17 +0000 (09:26 -0400)]
riscv: Compile instr_size.c into the kernel when DTrace is configured

Reported by: Jenkins
Fixes: 080e56a6c98c ("dtrace: expose dtrace_instr_size() to userland and implement it for riscv")

16 months agotcp: hpts needs to still call output even after input.
Randall Stewart [Fri, 21 Apr 2023 11:12:25 +0000 (07:12 -0400)]
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

16 months agopf.conf.5: minor improvements
Kristof Provost [Fri, 21 Apr 2023 07:16:53 +0000 (09:16 +0200)]
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")

16 months agompr: don't use hardcoded value in debug branch
Mariusz Zaborski [Fri, 21 Apr 2023 07:57:38 +0000 (09:57 +0200)]
mpr: don't use hardcoded value in debug branch

Pointed out by: imp
Sponsored by:   Klara Inc.

16 months agompr: fix copying of event_mask
Mariusz Zaborski [Fri, 21 Apr 2023 07:50:16 +0000 (09:50 +0200)]
mpr: fix copying of event_mask

Before the commit 6cc44223cb6717795afdac4348bbe7e2a968a07d 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

16 months agolinuxkpi: Fix __sg_alloc_table_from_pages loop
Austin Shafer [Fri, 21 Apr 2023 07:56:50 +0000 (09:56 +0200)]
linuxkpi: Fix __sg_alloc_table_from_pages loop

Commit 3e0856b63fe0e375a0951e05c2ef98bb2ebd9421 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: 3e0856b63fe0 ("linuxkpi: Fix `sg_alloc_table_from_pages()` to have the same API as Linux")

16 months agosyscalls: regenerate
Warner Losh [Fri, 21 Apr 2023 05:28:59 +0000 (23:28 -0600)]
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

16 months agosyscall.master: Remove stray 4.2
Warner Losh [Fri, 21 Apr 2023 05:05:30 +0000 (23:05 -0600)]
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

16 months agoRemove stray line
Warner Losh [Fri, 21 Apr 2023 05:04:40 +0000 (23:04 -0600)]
Remove stray line

Forgot to remove this in 559b94a12257.

Fixes: 559b94a12257
Sponsored by: Netflix

16 months agobsdinstall avoid subdir depending on parent
Simon J. Gerraty [Fri, 21 Apr 2023 05:00:40 +0000 (22:00 -0700)]
bsdinstall avoid subdir depending on parent

When not doing tree walks, it is bad for sub-dirs to depend on
parents.  Move the generation of opt_osname.h to distextract
and have others that need that depend on it.

In usr.sbin/bsdinstall use SUBDIR_DEPEND_ so tree walking still works.

Reviewed by: obrien
Differential Revision: https://reviews.freebsd.org/D39742

16 months agozoneinfo get zic from stage tree during DIRDEPS_BUILD
Simon J. Gerraty [Fri, 21 Apr 2023 04:00:17 +0000 (21:00 -0700)]
zoneinfo get zic from stage tree during DIRDEPS_BUILD

16 months agocxgbe(4): Update firmwares to version 1.27.3.0
Navdeep Parhar [Fri, 21 Apr 2023 01:24:57 +0000 (18:24 -0700)]
cxgbe(4): Update firmwares to version 1.27.3.0

These are the changes since the last update (copy-pasted from the
release notes for Chelsio Unified Wire v3.18.0.0):

====================
Version : 1.27.3.0
Date    : 04/07/2023

Fixes
-----
BASE:
- Fixed a hang if module eeprom reads gives invalid data.
- KR backlplane no-fec link problem fixed.
OFLD:
- iscsi ddp errors fixed.
- iwarp connection abort in rare cases causing NIC traffic hang fixed.

ENHANCEMENTS
------------
BASE:
- Cisco GLC-TE 1G modules support added.

====================
Version : 1.27.1.0
Date    : 12/02/2022

Fixes
-----
BASE:
- memwrite dsgl cannot be used for T5.
OFLD:
- Enabled FCoE in SO adapters.
- TOE-TLS crash fixed.
- iscsi hang fixed.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

16 months agoUpdate meta.sys.mk and related local*mk
Simon J. Gerraty [Fri, 21 Apr 2023 03:38:53 +0000 (20:38 -0700)]
Update meta.sys.mk and related local*mk

Move the setting of TARGET_SPEC_VARS to local.sys.env.mk
so meta.sys.mk can do the processing, and include local.meta.sys.mk
later.

Move the setting of GENDIRDEPS_FILTER*_VARS from local.gendirdeps.mk
to local.meta.sys.mk so we can automatically set DEP_* at level 1+
to avoid syntax errors when DEP_* variables are used in conditionals
in Makefile.depend files.

Update gendirdeps.mk just to get the documentation about the above.
No functional change.

local.dirdeps.mk be more careful about adding to DIRDEPS to avoid
unnecessary overhead, and introducing cycles in the graph.
Also set DEP_MACHINE_CPUARCH.

Reviewed by: stevek
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39737

16 months agoVendor import of libcbor 0.10.2
Ed Maste [Thu, 20 Apr 2023 23:17:42 +0000 (19:17 -0400)]
Vendor import of libcbor 0.10.2

16 months agosyscall.master: Fix comments
Warner Losh [Thu, 20 Apr 2023 22:16:21 +0000 (16:16 -0600)]
syscall.master: Fix comments

Have more accruate comments. While #if, #else, etc are copied to the
header files, lines that don't start with # are not.  And #include files
are only output to sysinc (which winds up at the front of init_sysent.c
which seems a bit odd). This is all radically undocumented, and likely
has drifted somewhat from 4.4BSD and what other systems do (they've
drifted too, fwiw).

Sponsored by: Netflix

16 months agomakesyscalls.lua: Minor fluff removal
Warner Losh [Thu, 20 Apr 2023 22:16:16 +0000 (16:16 -0600)]
makesyscalls.lua: Minor fluff removal

luacheck pointed out two minor issues: line isn't declared as a global,
so declare it local. Also remove an unused parameter.

Suggested by: kevans
Sponsored by: Netflix

16 months agomakesyscalls.lua: Use "sysxxx" consistently
Warner Losh [Thu, 20 Apr 2023 22:16:06 +0000 (16:16 -0600)]
makesyscalls.lua: Use "sysxxx" consistently

Find the few places where we use 'sysxxx' and use "sysxxx" instead to be
more consistent.

Sponsored by: Netflix

16 months agomakesyscalls.lua: Make more luaish
Warner Losh [Thu, 20 Apr 2023 22:15:57 +0000 (16:15 -0600)]
makesyscalls.lua: Make more luaish

x["y"] can be written as x.y, which looks better and is a more typical
lua idiom.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D39709

16 months agoopenssh: Update configure for DISABLE_LASTLOG
Ed Maste [Thu, 20 Apr 2023 00:03:26 +0000 (20:03 -0400)]
openssh: Update configure for DISABLE_LASTLOG

PR: 209441
Sponsored by: The FreeBSD Foundation

16 months agonetstat: cleanup
Michael Tuexen [Thu, 20 Apr 2023 21:52:19 +0000 (23:52 +0200)]
netstat: cleanup

protopr does not support reading from a core anymore.
So don't state that it can.

Reviewed by: glebius, rscheff, rrs
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D39688

16 months agoCirrus-CI: Run makeman script
Brooks Davis [Thu, 20 Apr 2023 21:38:10 +0000 (22:38 +0100)]
Cirrus-CI: Run makeman script

Run makeman and verify that src.conf.5 has been updated if
required and that there are no missing definition files.

Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D39682

16 months agoRemove unused NETLINK build option
Brooks Davis [Thu, 20 Apr 2023 21:34:31 +0000 (22:34 +0100)]
Remove unused NETLINK build option

NETLINK was added along side NETLINK_SUPPORT to control building netlink
specific programs, but it has no consumers so remove it for now.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D39678

16 months agosrc.conf.5: regen with WITH_NETLINK_SUPPORT desc
Brooks Davis [Thu, 20 Apr 2023 21:34:27 +0000 (22:34 +0100)]
src.conf.5: regen with WITH_NETLINK_SUPPORT desc

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D39677

16 months agoAdd WITH_NETLINK_SUPPORT description
Brooks Davis [Thu, 20 Apr 2023 21:34:21 +0000 (22:34 +0100)]
Add WITH_NETLINK_SUPPORT description

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D39676

16 months agocxgbe(4): Dump the firmware log before falling back to a minimal config.
Navdeep Parhar [Thu, 20 Apr 2023 19:43:45 +0000 (12:43 -0700)]
cxgbe(4): Dump the firmware log before falling back to a minimal config.

It might have errors that explain why the attempted configuration
failed.

MFC after: 1 week
Sponsored by: Chelsio Communications

16 months agonetstat: fix printing of TCP pcbs with -A
Gleb Smirnoff [Thu, 20 Apr 2023 19:41:03 +0000 (12:41 -0700)]
netstat: fix printing of TCP pcbs with -A

This change touches both kernel and netstat(1), but either of the changes
will fix printing pcb addresses with -A.

The thing is that historically netstat(1) treated TCP differently, and
printed tcpcb address instead of inpcb address.  This is not documented
anywhere!  With e68b3792440 these two addresses became the same.  It is
highly likely they will be the same for a long time, but it might be they
will start to differ again in a far future.  My proposal is to stop
treating TCP differently with netstat(1) and right now is a good opportunity
to do that, since there will be no behavior change at all.  The kernel
change to tcp_inptoxtp() will go into stable/14 to make it compatible with
netstat(1) binary from stable/13.  We can drop it later, probably together
with in_ppcb pointer from inpcb.  The in_ppcb in xinpcb will stay for size
compatibility.

Reviewed by: tuexen, rrs
Differential Revision: https://reviews.freebsd.org/D39736

16 months agokern.mk: clang >= 16 already infers ELFv2 for powerpc64
Dimitry Andric [Thu, 20 Apr 2023 19:27:11 +0000 (21:27 +0200)]
kern.mk: clang >= 16 already infers ELFv2 for powerpc64

There is no need to pass -mabi=elfv2 explicitly anymore, and with clang
16 in fact results in a "unused argument" warning.

MFC after: 3 days

16 months agodpaa2: add console support for FDT based systems
Bjoern A. Zeeb [Tue, 14 Feb 2023 15:53:13 +0000 (15:53 +0000)]
dpaa2: add console support for FDT based systems

Add DPAA2 console support for MC and AIOP (latter untested) for FDT
systems.  ACPI systems are prepared but need some proper bus function
in order to get the address from MC (and likely a file splitup then).
This will come at a later stage once other ACPI/FDT bus parts are
cleared up.
The work was originally done in July 2022 and finally switched to
bus_space[1] lately to be ready for main.

Suggested by: andrew [1]
Reviewed by: dsl
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D38592

16 months agoarm: Use C89 function declaration for db_read_bytes.
John Baldwin [Thu, 20 Apr 2023 18:00:46 +0000 (11:00 -0700)]
arm: Use C89 function declaration for db_read_bytes.

16 months agoperfmon(4): Use a C89 function definition for a SYSINIT.
John Baldwin [Thu, 20 Apr 2023 18:00:46 +0000 (11:00 -0700)]
perfmon(4): Use a C89 function definition for a SYSINIT.

16 months agoRemove a few more references to riscv64sf.
John Baldwin [Thu, 20 Apr 2023 18:00:46 +0000 (11:00 -0700)]
Remove a few more references to riscv64sf.

Fixes: 1ca12bd927d7 Remove the riscv64sf architecture.

16 months agodtrace: add register bindings for RISC-V
Christos Margiolis [Thu, 20 Apr 2023 16:25:37 +0000 (16:25 +0000)]
dtrace: add register bindings for RISC-V

Reviewed by: mhorne, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39611

16 months agodtrace: use dtrace_instr_size() in the riscv dtrace_subr.c
Christos Margiolis [Thu, 20 Apr 2023 16:24:03 +0000 (16:24 +0000)]
dtrace: use dtrace_instr_size() in the riscv dtrace_subr.c

No functional change intended.

Reviewed by: mhorne, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39652

16 months agodtrace: expose dtrace_instr_size() to userland and implement it for riscv
Christos Margiolis [Thu, 20 Apr 2023 16:21:46 +0000 (16:21 +0000)]
dtrace: expose dtrace_instr_size() to userland and implement it for riscv

dtrace_instr_size() is needed by the forthcoming RISC-V port of kinst,
as well as by libdtrace in D38825 for both amd64 and RISC-V.

Reviewed by: markj, mhorne
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39489

16 months agodtrace: get rid of uchar_t types
Christos Margiolis [Thu, 20 Apr 2023 16:19:42 +0000 (16:19 +0000)]
dtrace: get rid of uchar_t types

Callers are specifying uint8_t anyway and this slightly reduces
dependencies on compatibility typedefs.  No functional change intended.

Reviewed by: markj, mhorne
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39490