Commit Graph

283156 Commits

Author SHA1 Message Date
Simon J. Gerraty
976ba7f02a Enable building tar for non-FreeBSD host
For DIRDEPS_BUILD we need Makefile.depend.options to
force libegacy to be built on older FreeBSD and non-FreeBSD hosts.

Add readpassphrase to libegacy to avoid the need for libbsd on Linux

src.opts.mk disable TESTS for host if MK_host_egacy is yes

Reviewed by:	imp
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39766
2023-04-24 10:20:17 -07:00
Mateusz Guzik
c5b5f2d808 cp: Revert "If copy_file_range(2) fails with EXDEV, use fall-back."
This reverts commit 6433365490.

The error is not valid per api contract, it showed up as a regression
after 15f0b8c309

15f0b8c309 ("zfs: merge openzfs/zfs@9cd71c860 (master)") and was
subsequently in d012836fb6 ("zfs: fix up EXDEV handling for
clone_range").

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-24 16:04:53 +00:00
John Baldwin
9b02f2daf4 powerpc: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39733
2023-04-24 08:53:50 -07:00
John Baldwin
4640fd28a1 netstat: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39731
2023-04-24 08:53:50 -07:00
John Baldwin
672eba2435 ppp: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39730
2023-04-24 08:53:49 -07:00
John Baldwin
4b75b42ddb ndp: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39729
2023-04-24 08:53:49 -07:00
John Baldwin
bd22d268d3 rpc.umntall: Use valid prototype for function declaration with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39728
2023-04-24 08:53:49 -07:00
John Baldwin
7b043ce598 rpc.lockd: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39727
2023-04-24 08:53:49 -07:00
John Baldwin
0a04bb7a4f fdisk: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39726
2023-04-24 08:53:49 -07:00
John Baldwin
76318a013d libsmdb: Silence -Wstrict-prototype warnings.
Presumably upstream will fix this eventually.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39725
2023-04-24 08:53:49 -07:00
John Baldwin
14b57ade94 zlib: Silence -Wstrict-prototype warnings.
Presumably upstream will fix this eventually.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39724
2023-04-24 08:53:49 -07:00
Andrew Turner
c94e4d91da Clean up PCI DEN0115 driver probing
Rather than checking for the SMCCC version check if the PCI_VERSION
call returns a valid version.

Sponsored by:	Arm Ltd
2023-04-24 16:34:21 +01:00
Warner Losh
d4c78130f4 powerpc: syscalls.c is standard
No need to add it here, much less make it optional on ktr.

Sponsored by:		Netflix
2023-04-24 09:25:42 -06:00
Justin Hibbits
02f3b17fa5 Mechanically convert Xen netfront/netback(4) to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37800
2023-04-24 09:54:23 -04:00
Justin Hibbits
7814374b7c IfAPI: Hide the macros that touch ifnet members
Nothing should be directly touching the ifnet members, which are hidden
in <net/if_private.h>, so hide them in the same header to avoid errors
from users.

Sponsored by:	Juniper Networks, Inc.
2023-04-24 09:54:23 -04:00
Justin Hibbits
97583aa256 linuxkpi: Migrate to IfAPI
Summary:
Trivial changes for LinuxKPI to use IfAPI.  The 'bsdifp' looks unused,
so removed it instead of converting it to a pointer.

Bump __FreeBSD_version for change to struct net_device.

Reviewed by:	bz, hselasky
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39491
2023-04-24 09:54:22 -04:00
Andrew Turner
c3785c3eb0 Remove unneeded SMMU macros
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39186
2023-04-24 12:48:01 +01:00
Andrew Turner
cdd34e0038 Remove virtual addresses from smmu_pmap_remove_pages
This function needs to unmap all memory in a given SMMU context. Have
it iterate over all page table entries to find what has been mapped
rather than looking at virtual addresses.

While here use SMMU specific macros.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39185
2023-04-24 12:47:55 +01:00
Andrew Turner
b97e94d91e Move to a SMMU specific struct for the smmu pmap
This is not managed through the VM subsystem so only needs to hold the
data the SMMU driver needs.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39184
2023-04-24 12:47:50 +01:00
Andrew Turner
49ee1a7ef0 Create a common function to get the SMMU sid
Now the PCI drivers have a common interface to read the IOMMU xref
and SID create a common function to read it. This fixes an issue where
we will call into an ACPI specific function when booting with FDT when
both are enabled.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39183
2023-04-24 12:47:44 +01:00
Andrew Turner
913d04deed Add PCI_ID_OFW_IOMMU to the pci ecam ACPI driver
Teach the pci host generic ACPI attachment about PCI_ID_OFW_IOMMU. This
will be used by the arm64 smmu IOMMU driver to read the xref and ID
this interface provides in a bus-agnostic way.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39182
2023-04-24 12:47:38 +01:00
Andrew Turner
117beba8a8 arm64: Clean up smmu fdt xref handling
Use the xref from OF_xref_from_node for the smmu xref. We already have
a valid xref ID, there is no need to convert this to a memory address.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39181
2023-04-24 12:47:31 +01:00
Andrew Turner
8bc94f256e Remove redundant data from pci host generic
The bus tag and handle fields are already stored in the resource. Use
this with the bus_read/bus_write helper macros.

Sponsored by:	Arm Ltd
2023-04-24 12:33:50 +01:00
Andrew Turner
078a69abcb Use a uint64_t to store the arm64 mpidr
Use a single uint64_t to hole the mpidr register as we can break the
KBI on 14. Keep the macro so code can still be MFCd to 13.

Sponsored by:	Arm Ltd
2023-04-24 12:33:50 +01:00
Andrew Turner
c9a05c0722 Add a PCI driver that follows the Arm DEN0115 spec
Add a n attachment to the pci_host_generic driver for the Arm DEN0115
PCI Configuration Space Access Firmware Interface [1]. This can be used
when PCI controllers need to implement quirks in the PCI root bus.
To handle this the firmware implements a SMCCC interface the driver can
use to read and write the configuration register.

This has been tested on a Raspberry Pi 4 booting with EDK2.

[1] https://developer.arm.com/documentation/den0115/latest

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39228
2023-04-24 12:33:50 +01:00
Andrew Turner
7029f2c887 Allow pci_host_generic attachments to manage registers
To allow for attachments that don't use memory mapped registers add
a flag they can set when the base driver shouldn't map them.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39227
2023-04-24 12:33:50 +01:00
Andrew Turner
fb421e96c0 Make arm64 pcb padding explicit
There is padding between some fields. Mark those I have found so they
can be reused later if needed.

Sponsored by:	Arm Ltd
2023-04-24 12:33:50 +01:00
Andrew Turner
1bf4991bbc 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
2023-04-24 12:33:50 +01:00
Hu Shunchao
6ed3b9ca25 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
2023-04-24 14:17:51 +03:00
Val Packett
176939bd36 bcm5974: fix wellspring9 pressure settings to handle force sensitivity
Reviewed by:	wulf
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D34435
2023-04-24 12:41:52 +03:00
Val Packett
1f40866feb 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
2023-04-24 12:41:52 +03:00
Val Packett
3c08673438 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
2023-04-24 12:41:52 +03:00
Val Packett
b344bd3a7d 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
2023-04-24 12:41:52 +03:00
Simon J. Gerraty
a1bf1a1a75 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
2023-04-23 16:52:12 -07:00
Konstantin Belousov
043e24bdb0 posixshmcontrol(1): silently ignore inaccessible segments when listing
PR:	271038
Reported by:	rau8344@gmail.com
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-04-24 02:38:48 +03:00
Bjoern A. Zeeb
e51be73a60 ath10k: add man page
Add initial man page for ath10k.4.

MFC after:	2 months
2023-04-23 21:31:08 +00:00
Bjoern A. Zeeb
da8fa4e37a 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
2023-04-23 21:31:07 +00:00
Bjoern A. Zeeb
ebacd8013f 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
2023-04-23 21:31:07 +00:00
Bjoern A. Zeeb
06a1103fe3 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
2023-04-23 21:31:07 +00:00
Bjoern A. Zeeb
e17944a821 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
2023-04-23 21:31:07 +00:00
Bjoern A. Zeeb
88e71cc06d 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
2023-04-23 21:31:07 +00:00
Bjoern A. Zeeb
3c4ba5f554 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
2023-04-23 21:31:07 +00:00
Bjoern A. Zeeb
6c92544d7c 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
2023-04-23 21:29:49 +00:00
Simon J. Gerraty
baf2dc6476 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
2023-04-23 13:43:45 -07:00
Dimitry Andric
42162fb2fe 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
2023-04-23 20:59:06 +02:00
Mark Johnston
4b39a12830 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
2023-04-23 13:55:57 -04:00
Mark Johnston
ff13b92475 riscv: Implement bus_describe_intr() for nexus
Reviewed by:	mhorne
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39750
2023-04-23 13:55:57 -04:00
Mark Johnston
7623cc8f65 arm64: Implement bus_describe_intr() for nexus
Prompted by a compiler warning introduced by
e582d4a2b0 ("arm64: nexus code tidy-up").

Reviewed by:	mhorne, andrew
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39749
2023-04-23 13:55:57 -04:00
Mark Johnston
93998d166f 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:	7b92493ab1 ("inpcb: Avoid inp_cred dereferences in SMR-protected lookup")
2023-04-23 13:55:57 -04:00
Michael Tuexen
66d6fd5322 sctp: use constants from RFC 8260 to improve compliance
Keep the old constants for backwards compatibility.

MFC after:	1 week
2023-04-23 17:48:05 +02:00