Commit Graph

9323 Commits

Author SHA1 Message Date
Brooks Davis
3746e90118 NATM: Remove useless NETGRAPH_ATM_ATMPIF option
This code was removed as part of the NATM removal in 2017 and somehow
this option was missed.

MFC after:	3 days

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D38874
2023-03-02 23:40:05 +00:00
Stéphane Rochoy
1b10e191f3 superio,ftgpio: Add support for Fintek F81865 GPIO
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/674
Differential Revision: https://reviews.freebsd.org/D37893
2023-02-28 10:17:53 -07:00
Warner Losh
a4b92fefd2 kbd: Tweaks to KBD_DELAY[12]
Make sure NOTES has a different value than the defaults, and properly
document the default values in atkbdc(4) and bump .Dd

Sponsored by:		Netflix
2023-02-26 20:49:32 -07:00
Piotr Kubaj
e552cac3d7 powerpc64*: port mlx5, OFED, KTLS and krping
Summary:
This review ports mlx5 driver, kernel's OFED stack (userland is already enabled), KTLS and krping to powerpc64 and powerpc64le.

krping requires a small change since it uses assembly for amd64 / i386.

NOTE: On powerpc64le RDMA works fine in the userspace with libmlx5, but on powerpc64 it does not. The problem is that contrib/ofed/libmlx5/doorbell.h checks for SIZEOF_LONG but this macro exists on neither powerpc64* nor amd64. Thus, the file silently goes to the fallback function written for 32-bit architectures. It works fine on little-endian architectures, but causes a hard fail on big-endian. It's possible it may also cause some runtime issues on little-endian.
Thus, on powerpc64 I verified that RDMA works with krping.

Reviewers: #powerpc, hselasky

Subscribers: bdrewery, imp, emaste, jhibbits

Differential Revision: https://reviews.freebsd.org/D38786
2023-02-26 23:38:33 +01:00
Piotr Kubaj
f5a1c871e6 Revert "powerpc64*: port mlx5, OFED, KTLS and krping"
Wrong push, another commit was supposed to be pushed.

This reverts commit 83d6d8877e.
2023-02-26 00:57:41 +01:00
Piotr Kubaj
83d6d8877e powerpc64*: port mlx5, OFED, KTLS and krping
Summary:
This review ports mlx5 driver, kernel's OFED stack (userland is already enabled), KTLS and krping to powerpc64 and powerpc64le.

krping requires a small change since it uses assembly for amd64 / i386.

NOTE: On powerpc64le RDMA works fine in the userspace with libmlx5, but on powerpc64 it does not. The problem is that contrib/ofed/libmlx5/doorbell.h checks for SIZEOF_LONG but this macro exists on neither powerpc64* nor amd64. Thus, the file silently goes to the fallback function written for 32-bit architectures. It works fine on little-endian architectures, but causes a hard fail on big-endian. It's possible it may also cause some runtime issues on little-endian.
Thus, on powerpc64 I verified that RDMA works with krping.

Reviewers: #powerpc, hselasky

Subscribers: bdrewery, imp, emaste, jhibbits

Differential Revision: https://reviews.freebsd.org/D38786
2023-02-26 00:56:37 +01:00
Warner Losh
b5d248c0c8 kern: Remove gcc2_compiled stripping
Bruce added stripping of gcc2_compiled and other symbols when he made
the boot loader load the symbols for the kernel in 1995 (b5d89ca8ad)
before the FreeBSD 2.1 release.  This was copied around a bit and
tweaked over the years, but these symbols aren't produced by clang, nor
gcc12. The were to support dbx for a.out stabs format. gcc removed them
with stabs support last year. gcc 2.95.4 in FreeBSD 4.x continued to
emit these symbols unconditionally (it was missing a test for aout vs
elf it would appaer). They disappeared entirely with gcc 3.2.4 in 5.x
for all non a.out builds, and entirely in FreeBSD 6.x which had gcc
3.2.6.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D38764
2023-02-25 11:49:25 -07:00
Mike Karels
b739bc9860 sys/conf/NOTES: clean up whitespace
Most options in kernel config files use "options<space><tab>OPTION".
This allows the option to be commented out without shifting columns.
A few options had two tabs, and some had spaces.  Make them consistent.

I missed this file on the last pass.
2023-02-25 09:27:06 -06:00
Michael Paepcke
8d966fb02e sys/conf/NOTES add new KBD_DELAY kernel options
add section for new kernel keyboard options

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/649
2023-02-24 23:20:52 -07:00
Michael Paepcke
c51978f4b2 kbd: add KBD_DELAY1 and KBD_DELAY2
Allow to configure KBD_DELAY* via KERNCONF for user-land less embedded
and security appliances

Reviewed by: imp (folded)
Pull Request: https://github.com/freebsd/freebsd-src/pull/649
2023-02-24 23:19:05 -07:00
Warner Losh
e88e989439 armv5: Remove dead code
No need to mark anything as broken on armv5 anymore.

Sponsored by:		Netflix
Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D38583
2023-02-14 09:53:15 -07:00
Piotr Kubaj
8923de5905
ice(4): Update to 1.37.7-k
Notable changes include:

- DSCP QoS Support (leveraging support added in
  rG9c950139051298831ce19d01ea5fb33ec6ea7f89)
- Improved PFC handling and TC queue assignments (now all remaining
  queues are assigned to TC 0 when more than one TC is enabled and the
  number of available queues does not evenly divide between them)
- Support for dumping the internal FW state for additional debugging by
  Intel support
- Support for allowing "No FEC" to be a valid state for the LESM to
  negotiate when using non-standard compliant modules

Also includes various bug fixes and smaller enhancements, too.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	erj@
Tested by:	Jeff Pieper <jeffrey.pieper@intel.com>
MFC after:	3 days
Relnotes:	yes
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D38109
2023-02-13 17:29:44 -08:00
Warner Losh
1a1f7b7df7 zlib: Add proper NO_WSTRICT_PROTYPES too
Also move NO_WDEPRECATED_NON_PROTOTYPE to a better place...

Sponsored by:	Netflix
Noticed by:	jhb
Fixes:		b9f235ba31
2023-02-13 12:50:56 -07:00
Warner Losh
b80185c267 zlib: Use NO_WDEPRECATED_NON_PROTOTYPE
Also add it to kern.mk so it's available for module builds.

Sponsored by:		Netflix
Noticed by:		mjg
Fixes:			b9f235ba31
Differential Revision:	https://reviews.freebsd.org/D38550
2023-02-13 09:59:51 -07:00
Dmitry Chagin
06c07e1203 Complete removal of opt_compat.h
Since Linux emulation layer build options was removed there is no reason
to keep opt_compat.h.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D38548
MFC after:		2 weeks
2023-02-13 19:07:38 +03:00
Warner Losh
b9f235ba31 Properly conditionalize clang 15-only flags
Sponsored by:		Netflix
Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D38550
2023-02-13 08:19:00 -07:00
Mateusz Guzik
eca005d853 zlib: silence K&R warns
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-12 21:12:34 +00:00
Konstantin Belousov
5bb807fed4 amd64: record a dependency of vdso on its linker script
Reviewed by:	emaste, val_packett.cool
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38392
2023-02-09 04:36:39 +02:00
Dimitry Andric
a4a491e223 Merge llvm-project release/15.x llvmorg-15.0.0-9-g1c73596d3454
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.0-9-g1c73596d3454.

PR:		265425
MFC after:	2 weeks
2023-02-08 20:05:02 +01:00
Dimitry Andric
61cfbce334 Merge llvm-project release/15.x llvmorg-15.0.0-rc2-40-gfbd2950d8d0d
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.0-rc2-40-gfbd2950d8d0d.

PR:		265425
MFC after:	2 weeks
2023-02-08 20:04:56 +01:00
Doug Ambrisko
9c067b844f enic: Cisco VIC driver
This driver is based of the enic (Cisco VIC) DPDK driver.  It provides
basic ethernet functionality.  Has been run with various VIC cards to
do UEFI PXE boot with NFS root.
2023-02-06 08:46:02 -08:00
Simon J. Gerraty
e9d6b699d8 kern.post.mk we need .MAKE.DEPENDFILE for DIRDEPS_BUILD
When MK_DIRDEPS_BUILD is yes, we need .MAKE.DEPENDFILE left
alone

Reviewed by:	stevek
2023-02-05 14:50:31 -08:00
Elliott Mitchell
dcb4b13816 xen/timer: rename "timer.c" to "xen_timer.c"
The better to avoid conflicting with other files given how "timer.c"
isn't a very unique name.  ARM and RISC-V both have timer.c files.

Reviewed by: royger, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/609
Differential Revision: https://reviews.freebsd.org/D36258
2023-02-05 10:50:50 -07:00
Yuri
e4d3f1e40a hv_hid: Hyper-V HID driver
Hyper-V HID driver using hidbus/hms.

Reviewed by:	wulf
MFC after:	1 week
PR:		221074
Differential revision:	https://reviews.freebsd.org/D38140
2023-02-05 18:32:08 +03:00
Dag-Erling Smørgrav
69d94f4c76 Add tarfs, a filesystem backed by tarballs.
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	pauamma, imp
Differential Revision:	https://reviews.freebsd.org/D37753
2023-02-02 18:19:29 +01:00
Justin Hibbits
1bfa548b1f ifnet/API: Privatize the implementation of the drbr_* APIs
When ALTQ is enabled ifnet accessors already need to be called, largely
defeating the purpose of the inline.  To that extent, make the ALTQ form
functions in the netstack proper, and make them always available.

Reviewed By:	glebius
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38104
2023-01-31 15:02:14 -05:00
Justin Hibbits
3d100b2a5a Remove dme(4) from files
Fixes:	69759b0c69
2023-01-31 11:44:42 -05:00
Eric Joyner
2508da22cd
ice_ddp: Update package to 1.3.30.0
This updated DDP is intended to be used with the forthcoming ice(4)
driver update to 1.37.7-k. (But it will still work with the current
version.)

Co-authored-by: Piotr Kubaj <pkubaj@FreeBSD.org>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>

MFC after:	1 week
Sponsored by:	Intel Corporation
2023-01-24 14:19:54 -08:00
Mitchell Horne
b926b6db37 riscv: always include frame pointer
Specifically it is missing in kernel modules, meaning a proper backtrace
can't be constructed.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37657
2023-01-12 11:04:24 -04:00
Mitchell Horne
8372afd096 Clarify DTR_ENABLED make variable
Rename it to DTRACE_ENABLED.

Suggested by:	jhb
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-01-12 11:03:49 -04:00
Andrew Gallatin
8ea4182995 tcp: Build RACK and BBR stacks as a part of LINT
When RACK and BBR were added to the kernel, they were put
behind 'WITH_EXTRA_TCP_STACKS=1'.   Unfortunately that was
never added to any NOTES file, so RACK & BBR were not compiled
with the various LINT-NOINET, LINT-NOINET6, and LINT-NOIP kernels.
This lead to the stacks sometimes being broken.

This change:

- Fixes RACK so that it compiles with the various LINT-NO* kernels
- Adds WITH_EXTRA_TCP_STACKS=1 to all NOTES kernels so that
   RACK and BBR are compile tested regularly

Sponsored by: Netflix
Reviewed by: rrs
Differential Revision: https://reviews.freebsd.org/D37903
2023-01-10 16:16:43 -05:00
Søren Schmidt
4ffe60e683 Add Combo PHY, RK817, Syr827, tcs4525 pmic devices to Rockchip specific config. 2023-01-08 03:07:18 +00:00
Søren Schmidt
5723e5ac6d Add Naneng combo PHY support for RK3568 SoC.
It can be used as pcie-phy, usb3-phy, sata-phy or sgmii-phy.
2023-01-06 03:04:53 +00:00
Søren Schmidt
7daf96523b Add PCIe driver for RK3568 SoC.
PCIe3 ports work, however PCIe2x1 is not working yet in this case as it depends on Naneng Combo Phy driver.
2023-01-05 04:15:56 +00:00
Takanori Watanabe
99aeb219ca wdatwd: Add support for ACPI WDAT based watchdog timer.
Simply said, WDAT is an abstraction for the real WDT hardware. For
instance, to add a newer generation WDT to ichwd(4), one must know the
detailed hardware registers, etc..

With WDAT, the necessary IO accesses to operate the WDT are comprehensively
described in it and no hardware knowledge is required.

With this driver, the WDT on Advantech ARK-1124C, Dell R210 and Dell R240 are
detected and operated flawlessly.
* While R210 is also supported by ichwd(4), others are not supported yet.

The unfortunate thing is that not all systems have WDAT defined.

Submitted by: t_uemura at macome.co.jp
Reviewed by: hrs
Differential Revision: https://reviews.freebsd.org/D37493
2023-01-04 00:36:24 +09:00
Dimitry Andric
526f57bf85 Update CWARNFLAGS in bsd.sys.mk and CWARNEXTRA in kern.mk for clang 15.
MFC after:	3 days
2022-12-25 12:58:22 +01:00
Alexander V. Chernikov
c9313a0bad netlink: allow netlink to be build in the kernel
Differential Revision: https://reviews.freebsd.org/D37781
2022-12-23 15:24:44 +00:00
Søren Schmidt
702b53dd2a Add initial support for the RK356X SOC Ethernet QoS controller (DesignWare)
Eqos driver works in all combinations of single/double ports with different layout.
2022-12-22 03:38:10 +00:00
John Baldwin
3266131908 Fix spelling of NO_WINFINITE_RECURSION.
Reported by:	dim
Fixes:		2e08e4b75e zfs: Fix build with GCC 12.
2022-12-21 14:45:29 -08:00
John Baldwin
2e08e4b75e zfs: Fix build with GCC 12.
Silence -Winfinite-recursion for ldo.c in lua and -Wstringop-overread
for nvpair.c.

Reviewed by:	mm
Differential Revision:	https://reviews.freebsd.org/D37631
2022-12-21 10:49:23 -08:00
John Baldwin
1aa6d44dec Disable -Wzero-length-bounds for the kernel for GCC 12.
The mlx5 driver and some other OFED bits use a somewhat dubious
pattern of:

  struct foo {
      uint64_t arg[0];
      /* Real members of a struct */
  };

The code then treats 'arg' as if it were really a kind of union
such that foo.arg[N] functions similarly to (uint64_t *)foo[N].
This uses of foo.arg[N] then trigger this warning.

No real bugs were found by this warning though, so just turn it off
globally.

Reviewed by:	hselasky, kib
Differential Revision:	https://reviews.freebsd.org/D37630
2022-12-21 10:48:15 -08:00
John Baldwin
2637ed558b Disable -Wdangling-pointer for the kernel for GCC 12.
Some of the warnings raised in the kernel seem to be outright bugs in
the compiler (e.g. the cases in ata_xpt.c and scsi_xpt.c).  Other
cases are not fatal and it didn't seem to find any legitimate bugs in
the kernel.

Differential Revision:	https://reviews.freebsd.org/D37629
2022-12-21 10:46:26 -08:00
John Baldwin
488c498b09 Disable errors for -Wnonnull for the kernel for GCC 12.
The USB code and some other places raise false positives when a NULL
pointer is passed to an inlined function along with a separate length
and the compiler can't determine that the separate length of 0
prevents the use of the NULL pointer.

Differential Revision:	https://reviews.freebsd.org/D37627
2022-12-21 10:46:06 -08:00
Søren Schmidt
e00b6e254f Attach Motorcomm YT8511 GbE PHY driver to the build. 2022-12-21 14:39:05 +00:00
Andrew Turner
969935b86b Add support for an array of hwresets
In some drivers we need to assert and deassert a group of hardware
resets in any order. To support this add a new hwreset_array that
manages all hwresets defined for a device.

Reviewed by:	bz, manu, mmel
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37357
2022-12-21 11:25:23 +00:00
Søren Schmidt
e7815784cc Add Rockchip RK3568 SoC
Attach its clock drivers and rk817 pmic driver to the build.
2022-12-20 03:01:41 +00:00
Ruslan Bukin
54b96380f5 Add support for ARM System Control and Management Interface (SCMI) v3.1.
The SCMI specification describes a set of standard interfaces for power,
performance and system management.

SCMI is extensible and provides interfaces to access functions which are
often implemented in firmwares in the System Control Processor (SCP).

This implements Shared Memory-based transfer, which is one of the ways on
how messages are exchanged between agents and the platform.

This includes a driver for ARM Message Handling Unit (MHU) Doorbell, which
is a mechanism that the caller can use to alert the callee of the presence
of a message.

The support implements clock management interface. For instance this allows
us to control HDMI pixel clock on ARM Morello Board.

Tested on ARM Morello Board.

Obtained from: CheriBSD
Differential Revision:	https://reviews.freebsd.org/D37316
Reviewed by:	manu
Sponsored by:	UKRI
2022-12-19 22:28:21 +00:00
Gleb Smirnoff
eaabc93764 tcp: retire TCPDEBUG
This subsystem is superseded by modern debugging facilities,
e.g. DTrace probes and TCP black box logging.

We intentionally leave SO_DEBUG in place, as many utilities may
set it on a socket.  Also the tcp::debug DTrace probes look at
this flag on a socket.

Reviewed by:		gnn, tuexen
Discussed with:		rscheff, rrs, jtl
Differential revision:	https://reviews.freebsd.org/D37694
2022-12-14 09:54:06 -08:00
Mark Johnston
ab8b2d108c sys/conf: Remove an unneeded flag variable
After commit fac6dee9eb ("Remove tests for obsolete compilers in the
build system"), we always set -fdebug-prefix-map, so there's no point in
defining and testing _MAP_DEBUG_PREFIX.  No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-12-14 09:32:17 -05:00
Li-Wen Hsu
d969aeab73
Complete retire cp(4)
Sponsored by:	The FreeBSD Foundation
2022-12-14 11:42:36 +08:00
Ed Maste
895992bb66 retire cp(4) driver
Sync serial (e.g. T1/T1/G.703) interfaces are obsolete, this driver
includes obfuscated source, and has reported potential security issues.

Differential Revision:  https://reviews.freebsd.org/D33468
2022-12-13 15:24:52 -05:00
Ed Maste
76f6751844 retire ce(4) driver
Sync serial (e.g. T1/T1/G.703) interfaces are obsolete, this driver
includes obfuscated source, and has reported potential security issues.

Differential Revision:	https://reviews.freebsd.org/D33467
2022-12-13 15:24:25 -05:00
Gleb Smirnoff
e68b379244 tcp: embed inpcb into tcpcb
For the TCP protocol inpcb storage specify allocation size that would
provide space to most of the data a TCP connection needs, embedding
into struct tcpcb several structures, that previously were allocated
separately.

The most import one is the inpcb itself.  With embedding we can provide
strong guarantee that with a valid TCP inpcb the tcpcb is always valid
and vice versa.  Also we reduce number of allocs/frees per connection.
The embedded inpcb is placed in the beginning of the struct tcpcb,
since in_pcballoc() requires that.  However, later we may want to move
it around for cache line efficiency, and this can be done with a little
effort.  The new intotcpcb() macro is ready for such move.

The congestion algorithm data, the TCP timers and osd(9) data are
also embedded into tcpcb, and temprorary struct tcpcb_mem goes away.
There was no extra allocation here, but we went through extra pointer
every time we accessed this data.

One interesting side effect is that now TCP data is allocated from
SMR-protected zone.  Potentially this allows the TCP stacks or other
TCP related modules to utilize that for their own synchronization.

Large part of the change was done with sed script:

s/tp->ccv->/tp->t_ccv./g
s/tp->ccv/\&tp->t_ccv/g
s/tp->cc_algo/tp->t_cc/g
s/tp->t_timers->tt_/tp->tt_/g
s/CCV\(ccv, osd\)/\&CCV(ccv, t_osd)/g

Dependency side effect is that code that needs to know struct tcpcb
should also know struct inpcb, that added several <netinet/in_pcb.h>.

Differential revision:	https://reviews.freebsd.org/D37127
2022-12-07 09:00:48 -08:00
Doug Rabson
eb6f48854d Fix a typo in the binmisc option name
This should be spelt IMGACT_BINMISC to match the filename. The option
name does not appear outside of sys/conf and this module is typically
used via the kernel module imgact_binmisc.ko.

MFC After: 2 weeks
2022-12-07 13:51:34 +00:00
Robert Wing
dacbe4d533 config: remove LOCK_PROFILING_FAST
This option lived a short life in 2007.

last used eea4f254fe

Reviewed by:	mjg
Differential Revision:	https://reviews.freebsd.org/D37600
2022-12-05 08:03:52 -09:00
John Baldwin
5115511ed4 Use __freebsd_kprintf__ with GCC 12+ similar to clang. 2022-11-22 08:36:12 -08:00
Martin Matuska
dbd5678dca zfs: merge openzfs/zfs@2163cde45
Notable upstream pull request merges:
  #13680 Add options to zfs redundant_metadata property
  #13758 Allow mounting snapshots in .zfs/snapshot as a regular user
  #13838 quota: disable quota check for ZVOL
  #13839 quota: extend quota for dataset
  #13973 Fix memory leaks in dmu_send()/dmu_send_obj()
  #13977 Avoid unnecessary metaslab_check_free calling
  #13978 PAM: Fix unchecked return value from zfs_key_config_load()
  #13979 Handle possible null pointers from malloc/strdup/strndup()
  #13997 zstream: allow decompress to fix metadata for uncompressed
         records
  #13998 zvol_wait logic may terminate prematurely
  #14001 FreeBSD: Fix a pair of bugs in zfs_fhtovp()
  #14003 Stop ganging due to past vdev write errors
  #14039 Optimize microzaps
  #14050 Fix draid2+2s metadata error on simultaneous 2 drive failures
  #14062 zed: Avoid core dump if wholedisk property does not exist
  #14077 Propagate extent_bytes change to autotrim thread
  #14079 FreeBSD: vn_flush_cached_data: observe vnode locking contract
  #14093 Fix ARC target collapse when zfs_arc_meta_limit_percent=100
  #14106 Add ability to recompress send streams with new compression
         algorithm
  #14119 Deny receiving into encrypted datasets if the keys are not
         loaded
  #14120 Fix arc_p aggressive increase
  #14129 zed: Prevent special vdev to be replaced by hot spare
  #14133 Expose zfs_vdev_open_timeout_ms as a tunable
  #14135 FreeBSD: Fix out of bounds read in zfs_ioctl_ozfs_to_legacy()
  #14152 Adds the `-p` option to `zfs holds`
  #14161 Handle and detect #13709's unlock regression

Obtained from:	OpenZFS
OpenZFS commit:	2163cde450
2022-11-16 21:27:42 +01:00
Andrew Turner
8a2adde1e4 Split out the arm64 EL2 exception vectors
These were originally in locore.S as they are only needed so we have
a valid value to put into the vbar_el2 register. As these will soon
be used by bhyve so move them to a new file as we already have with
the EL1 exception vectors in exception.S.

Obtained from:	https://github.com/FreeBSD-UPB/freebsd-src (earlier version)
Sponsored by:	Innovate UK
Sponsored by:	The FreeBSD Foundation
2022-11-15 17:26:52 +00:00
Luiz Amaral
813c5b75e6 pfsync: prepare code to accommodate AF_INET6 family
Work is ongoing to add support for pfsync over IPv6. This required some
changes to allow for differentiating between the two families in a more
generic way.

This patch converts the relevant ioctls to using nvlists, making future
extensions (such as supporting IPv6 addresses) easier.

Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D36277
2022-11-09 21:06:07 +01:00
Mark Johnston
3c0e9169a3 ksan: Build sanitizer runtimes without stack-smashing protection
On arm64 with per-thread stack canaries enabled (the PERTHREAD_SSP
option), the compiler may load curthread->td_md.md_canary in function
prologues.  This is not safe in data_abort(); see commit 2c10be9e06.
Thus, sanitizer runtimes must also avoid accessing the current thread's
canary.

Since SSP has limited utility in sanitizer runtimes, simply disable it
unconditionally to avoid unpleasant surprises in the future.

MFC after:	2 weeks
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
2022-11-07 16:10:48 -05:00
Sumit Saxena
58d84ef870 if_bnxt: Added support for mgmt interface for passthrough hwrms
Added support for application management interface. There are two types of commands supported:

1. Firmware IOCTLs: These ioctls are meant for firmware
   consumption. Driver acts as a transport for these.
2. Driver only IOCTLs: These ioctls are meant for driver
   consumption. Driver will serve these ioctls without sending them down
   to firmware.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36448
2022-11-04 16:40:29 -06:00
Andrew Turner
d98911f690 Hyper-V depends on ACPI, mark as such in files.arm64
Sponsored by:	The FreeBSD Foundation
2022-11-03 15:11:25 +00:00
Andrew Turner
4343f4019f Place the hyperv files with other dev files
Move the files enabled by hyperv with others under sys/dev rather than
at the end of the file.

Sponsored by:	The FreeBSD Foundation
2022-11-03 15:05:04 +00:00
Andrew Turner
f98c118e2e Clean up "optional hyperv" indentation in files.arm64
Make them all align and use a space after "optional"

Sponsored by:	The FreeBSD Foundation
2022-11-03 15:03:27 +00:00
Andrew Turner
4c52da33a2 Mark ar64 drivers that depend on fdt as such
These drivers all attach to one of the OFW/FDT busses. check for fdt
in the kernel config before building.
2022-11-03 09:45:47 +00:00
Andrew Turner
cc72012d42 Make all options lower case in files.arm64
Some of the SOC options were upper case. Make them lower to be
consistent with the rest of the file.
2022-11-03 09:45:47 +00:00
Andrew Turner
19db791d6b Mark soc_intel_stratix10 drivers as needing FDT
These files all need FDT so check for it before building.
2022-11-03 09:45:47 +00:00
Elliott Mitchell
ccd9b49f20 sys: use .S for assembly language files that use the preprocessor
Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/609
Differential Revision: https://reviews.freebsd.org/D35908
2022-11-02 10:29:00 -04:00
Warner Losh
25b1b63dba dtb: Be much less verbose in the building of dtb
Make the dtb/dtbo files with less noise. Remove echo statements, but add
back the call for the non-meta builds to replace the removed noise.

Suggetions by:		jrtc27
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D37073
2022-10-29 10:13:54 -06:00
John Baldwin
744bfb2131 Import the WireGuard driver from zx2c4.com.
This commit brings back the driver from FreeBSD commit
f187d6dfbf plus subsequent fixes from
upstream.

Relative to upstream this commit includes a few other small fixes such
as additional INET and INET6 #ifdef's, #include cleanups, and updates
for recent API changes in main.

Reviewed by:	pauamma, gbe, kevans, emaste
Obtained from:	git@git.zx2c4.com:wireguard-freebsd @ 3cc22b2
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36909
2022-10-28 13:36:12 -07:00
Andrew Turner
227046a4d2 Enable more extres options when FDT is missing
These now build when FDT is not included in the kernel config.

Sponsored by:	Innovate UK
2022-10-28 18:31:56 +01:00
Jung-uk Kim
19ee8335c5 acpica: Merge ACPICA 20221020 2022-10-27 22:04:32 -04:00
Andrew Turner
64c3edc237 Allow the extres regulator code to build without FDT
This allows drivers that use this to build in an ACPI only kernel.

Sponsored by:	The FreeBSD Foundation
2022-10-27 17:28:56 +01:00
Andrew Turner
16625cabab Only build if_mvneta.c when FDT is defined
This is only ever used by a FDT specific attachment and calls into
FDT specific functions. Only build it when FDT is in the kernel config.
Sponsored by:	The FreeBSD Foundation
2022-10-27 17:21:02 +01:00
Andrew Turner
7b43fba03a Mark FDT only drivers as such
These drivers have FDT bindings, but not ACPI. Mark them as FDT only
to help a no-FDT LINT kernel build.

Sponsored by:	The FreeBSD Foundation
2022-10-27 17:06:15 +01:00
Souradeep Chakrabarti
9729f076e4 arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 3, final)
This is the last part for ARM64 Hyper-V enablement. This includes
commone files and make file changes to enable the ARM64 FreeBSD
guest on Hyper-V. With this patch, it should be able to build
the ARM64 image and install it on Hyper-V.

Reviewed by:	emaste, andrew, whu
Tested by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D36744
2022-10-27 13:53:22 +00:00
Warner Losh
4355ab6f04 config.mk: All options in DEFAULTS are now defined in opt_global.h
To simplify management of all the options that should be enabled for the
different architectures, adopt the convention that all options listed in
DEFAULTS will be #defined to 1 in opt_global.h for untied builds. Except
for GEOM_* and ISAPNP, they are all in opt_global.h. ISAPNP is a
opt_dontuse.h, so only filter GEOM_*.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D37108
2022-10-24 12:13:04 -06:00
Warner Losh
d6f1e6aa11 config: Make ISAPNP be in opt_dontuse.h
Nothing uses ISAPNP today, apart from bringing in files or not. There's
really no need to ever do #ifdef ISAPNP in drivers and such. It means
use the ISA bus plug and play isolation protocol to enumerate the bus,
not the more useful 'you might have devices with isa pnp ids' which all
drivers hide behind DEV_ISA and/or an isa clause in the files files.

Sponsored by:		Netflix
Reviewed by:		kevans, emaste
Differential Revision:	https://reviews.freebsd.org/D37109
2022-10-24 12:13:03 -06:00
Takanori Watanabe
a9880bfe11 acpi_ged: New driver to ACPI generic event device
New driver to ACPI generic event device, defined in ACPI spec.
Some ACPI power button may not work without this.

In qemu arm64 with "virt" machine, with ACPI firmware,
enable devd check devd message by
and invoke following command in qemu monitor
(qemu) system_powerdown
and make sure some power button input event appear.
(setting sysctl hw.acpi.power_button_state=S5 is not work,
because ACPI tree does not have \_S5 object.)

Reviewed by: andrew, hrs
Differential Revision: https://reviews.freebsd.org/D37032
2022-10-24 18:57:36 +09:00
Warner Losh
91dc225a7b conf: Document why we have ARM64 and RISCV options
These are needed for the 'cpu ARM64' and 'cpu RISCV' options in these
architecture's config files. cpu lines are non-optional in config(8), so
we must define them here. There's no other use for them in the tree.

Sponsored by:		Netflix
2022-10-20 10:48:31 -06:00
Warner Losh
f9d615746f arm: Remove useless armv6/armv7 options
Cleanup another remnant of the armv4/armv5 support. Now that we always
define armv6 or armv7, these lines can be deleted (execpt hwpmc_armv7.c
which now needs just one line). Since we don't do anything different
between armv6 and armv7 from a config file selection point of view,
delete them from options.arm. We are extremely unlikely to grow anything
new here during the remaining lifetime of 32-bit arm in FreeBSD.

Sponsored by:		Netflix
Reviewed by:		kevans, andrew
Differential Revision:	https://reviews.freebsd.org/D37069
2022-10-20 10:48:31 -06:00
Colin Percival
d1ca8cc638 x86: Add MPTABLE_LINUX_BUG_COMPAT option
Linux has two bugs in its handling of the x86 MP table:
1. It assumes that there is always 640 kB of base memory, and looks for
the MP table in the top kB of this even if the memory map indicates
that memory location does not exist.
2. It ignores that entry_count field and instead iterates through the
MP table by scanning until it runs out of bytes in the table.

The Firecracker VM (and probably other related VMs) relies on both of
these bugs.  With the MPTABLE_LINUX_BUG_COMPAT option, we search for
the MP table at address 639k even if that isn't in the memory map; and
replace a zeroed entry_count with a value computed from scanning the
table until we run out of table bytes.

Reviewed by:	imp
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D35799
2022-10-17 23:02:22 -07:00
Colin Percival
2297a1633d Add NO_LEGACY_PCIB kernel option to i386, amd64
On systems without a PCI bus, legacy_pcib_identify by default creates
one anyway:
    legacy_pcib_identify: no bridge found, adding pcib0 anyway

This commit adds a kernel option NO_LEGACY_PCIB which disables this,
allowing systems to be fully PCI-free.

Reviewed by:	imp
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D35798
2022-10-17 23:02:22 -07:00
Colin Percival
0e1f5ab7db virtio_mmio: Support command-line parameters
The Virtio MMIO bus driver was added in 2014 with support for devices
exposed via FDT; in 2018 support was added to discover Virtio MMIO
devices via ACPI tables, as in QEMU.  The Firecracker VMM eschews both
FDT and ACPI, instead presenting device information via kernel command
line arguments of the form virtio_mmio.device=<parameters>.

These command line parameters get converted into kernel environment
variables; this adds support for parsing those variables and attaching
virtio_mmio children to nexus.

There is a case to be made that it would be cleaner to have a new
"cmdlinebus" attached to nexus and virtio_mmio children attached to
that.  A future commit might do that.

Discussed with:	imp, jrtc27
Sponsored by:	https://patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D36189
2022-10-17 23:02:21 -07:00
Dmitry Salychev
ba7319e909
Add initial DPAA2 support
DPAA2 is a hardware-level networking architecture found in some NXP
SoCs which contain hardware blocks including Management Complex
(MC, a command interface to manipulate DPAA2 objects), Wire Rate I/O
processor (WRIOP, packets distribution, queuing, drop decisions),
Queues and Buffers Manager (QBMan, Rx/Tx queues control, Rx buffer
pools) and the others.

The Management Complex runs NXP-supplied firmware which provides DPAA2
objects as an abstraction layer over those blocks to simplify an
access to the underlying hardware. Each DPAA2 object has its own
driver (to perform an initialization at least) and will be visible
as a separate device in the device tree.

Two new drivers (dpaa2_mc and dpaa2_rc) act like firmware buses in
order to form a hierarchy of the DPAA2 devices:

	acpiX (or simplebusX)
	  dpaa2_mcX
	    dpaa2_rcX
	      dpaa2_mcp0
	      ...
	      dpaa2_mcpN
	      dpaa2_bpX
	      dpaa2_macX
	      dpaa2_io0
	      ...
	      dpaa2_ioM
	      dpaa2_niX

dpaa2_mc is suppossed to be a root of the hierarchy, comes in ACPI
and FDT flavours and implements helper interfaces to allocate and
assign bus resources, MSI and "managed" DPAA2 devices (NXP treats some
of the objects as resources for the other DPAA2 objects to let them
function properly). Almost all of the DPAA2 objects are assigned to
the resource containers (dpaa2_rc) to implement isolation.

The initial implementation focuses on the DPAA2 network interface
to be operational. It is the most complex object in terms of
dependencies which uses I/O objects to transmit/receive packets.

Approved by:		bz (mentor)
Tested by:		manu, bz
MFC after:		3 months
Differential Revision:	https://reviews.freebsd.org/D36638
2022-10-14 22:49:09 +02:00
Andrew Turner
e590c9eff8 Fix the options to build rk_usb2phy.c
We need to check for fdt rk_usb2phy on both sides of the '|'.

Sponsored by:	The FreeBSD Foundation
2022-10-06 14:30:18 +01:00
Kyle Evans
b4c2a5b689 arm64: coresight: fix the build without FDT
coresight_cpu_debug only has an FDT attachment, so let's not build it
for kernels without FDT.

coresight.h includes sys/malloc.h via header pollution
dev/ofw/openfirm.h; include it directly in case we're building without
FDT.

Reviewed by:	andrew, manu
Differential Revision:	https://reviews.freebsd.org/D36789
2022-09-29 14:33:33 -05:00
Andrew Turner
efd899cd04 The cmn600 and cmn620 drivers are ACPI
These drivers only have attachments for ACPI. Mark as such in
files.arm64.

Sponsored by:	The FreeBSD Foundation
2022-09-29 16:34:10 +01:00
Bjoern A. Zeeb
f8bad56164 LinuxKPI: add the "dummy" includes directory to builds
While we could add the dummy includes directory manually to only the
drivers needing it, it seems a lot easier to simply add it to all
without any expected harm.

This is needed for more drivers (and to remove some #ifdef in current
ones) with empty header files being present not yielding errors.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	hselasky, imp
Differential Revision: https://reviews.freebsd.org/D36684
2022-09-26 19:36:44 +00:00
Bjoern A. Zeeb
514fb38721 LinuxKPI: define LINUXKPI_INCLUDES for module builds as well
While for in-kernel we already have LINUXKPI_INCLUDES in kern.pre.mk
for kmod builds we've not had a common define to use leading to various
spellings of include paths.

In order for the include list to be expanded more easily in the future,
e.g., adding the "dummy" includes (for all) and to harmonize code,
duplicate LINUXKPI_INCLUDES to kmod.mk and use it for all module Makefiles.

MFC after:	1 week
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D36683
2022-09-26 19:34:01 +00:00
Martin Matuska
c7046f76c2 zfs: merge openzfs/zfs@c629f0bf6
Notable upstream pull request merges:
  #13725 Fix BLAKE3 tuneable and module loading on Linux and FreeBSD
  #13756 FreeBSD: Organize sysctls
  #13773 FreeBSD: add kqfilter support for zvol cdev
  #13781 Importing from cachefile can trip assertion
  #13794 Apply arc_shrink_shift to ARC above arc_c_min
  #13798 Improve too large physical ashift handling
  #13799 Revert "Avoid panic with recordsize > 128k, raw sending and
         no large_blocks"
  #13802 Add zfs.sync.snapshot_rename
  #13831 zfs_enter rework
  #13855 zfs recv hangs if max recordsize is less than received
         recordsize

Obtained from:	OpenZFS
OpenZFS commit:	c629f0bf62
2022-09-21 14:17:13 +02:00
Jake Freeland
f697b9432d linuxkpi: drm-kmod debugfs support
This diff extends LinuxKPI to support simple attribute files in debugfs.
These simple attributes are an essential component for compiling drm-kmod
with CONFIG_DEBUG_FS enabled.
This will allow for easier graphics driver debugging using
Intel's igt-gpu-tools.

Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D35883
Sponsored by:	Google, Inc. (GSoC 2022)
2022-09-20 19:41:10 +02:00
Jakub Kołodziej
b8a083ea32 gpio: Merge TCA6416 & TCA6408 drivers into TCA64XX
This merges TCA6416, TCA6408 drivers and adds PCA9555 support.
They handle 8 pin and 16 pin ICs with basic INPUT/OUTPUT functionality.
The register map is fairly similar so there is no point in having two
separate drivers.

Reviewed by:	kd
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36559
2022-09-19 09:18:08 +02:00
Ed Maste
9054e29681 Retire ISA sound card DMA support
As all ISA sound card drivers have been removed sndbuf_dma no longer
serves any purpose.

Reviewed by:	mav
Relnotes: 	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34671
2022-09-15 10:07:23 -04:00
Jessica Clarke
129028c79c da9063_rtc: Add new driver for the Dialog Semiconductor DA9063 RTC
This is a simple RTC present in the PMIC, supporting 1s precision.

This is the PMIC on SiFive's HiFive Unmatched.

Reviewed by:	mhorne, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36200
2022-09-13 17:46:21 +01:00
Jessica Clarke
80466455ad da9063_iic: Add new driver for the Dialog Semiconductor DA9063 PMIC
This is an MFD with regulators, an RTC and a watchdog, among other
things. This adds the necessary infrastructure for specific children to
be added.

Note that the PMIC can also be attached via SPI, not just I2C, and so
the interface is abstracted. No SPI implementation is added, however.

This is the PMIC on SiFive's HiFive Unmatched.

Reviewed by:	manu, mhorne
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36199
2022-09-13 17:46:09 +01:00
Richard Scheffenegger
bb1d472d79 tcp: make CUBIC the default congestion control mechanism.
This changes the default TCP Congestion Control (CC) to CUBIC.
For small, transactional exchanges (e.g. web objects <15kB), this
will not have a material effect. However, for long duration data
transfers, CUBIC allocates a slightly higher fraction of the
available bandwidth, when competing against NewReno CC.

Reviewed By: tuexen, mav, #transport, guest-ccui, emaste
Relnotes: Yes
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36537
2022-09-13 12:09:21 +02:00
Adrian Chadd
7d0e83c60b arm: add dwc3/xhci as build options for ARM
Summary:
This mirrors the recentish changes to armv8; the ipq4018 port uses
dwc3 + xhci and thus needs this.

Subscribers: imp, andrew

Reviewed by: imp

Differential Revision: https://reviews.freebsd.org/D36530
2022-09-11 19:36:42 -07:00
Dag-Erling Smørgrav
d3791ac46a NOTES: add Veriexec options and modules.
Sponsored by:	Klara, Inc.
MFC after:	1 week
2022-09-09 14:11:19 +02:00
Andrew Turner
949bc17cf2 Import the arm64 Cortex Strings memset into the kernel
Bring in the last version of the optimized memset from the Cortex
Strings library that didn't use the VFP registers. While here clean up
to use the ENTRY/EDIT macros.

This is imported from:
https://git.linaro.org/toolchain/cortex-strings.git/tree/src/aarch64/memset.S?id=bc654e7a594385071b42db3c9c94bd0fd5fe0da5

Sponsored by:	The FreeBSD Foundation
2022-09-08 14:30:09 +01:00
Andrew Turner
51a1bf7ba7 Import an optimized arm64 memcmp into the kernel
Bring in a version of the Arm Optimized Routines memcpy from before
the VFP registers were used.

Imported with modification from:
https://github.com/ARM-software/optimized-routines/blob/e823e3abf5f89ecb/string/aarch64/memcmp.S

Sponsored by:	The FreeBSD Foundation
2022-09-08 14:29:37 +01:00
Andrew Turner
8c6e5d8cf1 Import an optimized str{n}cmp on arm64
These are from the Arm Optimized Routines and don't use the VFP so are
safe to use in the kernel.

Sponsored by:	The FreeBSD Foundation
2022-09-08 14:23:20 +01:00
Andrew Turner
01e478d955 Update the arm64 kernel memcpy/memmove
Bring in the latest Arm Optimized Routines memcpy/memmove into the
arm64 kernel. As these functions have been merged in the current
version remove the now unneeded memmove.S.

Sponsored by:	The FreeBSD Foundation
2022-09-08 14:23:20 +01:00
Gleb Smirnoff
aa74cc6d6f divert(4): do not depend on ipfw(4)
Although originally socket was intended to use with ipfw(4) only, now
it also can be used with pf(4).  On a kernel without packet filters,
it still can be used to inject traffic.
2022-09-06 20:54:57 -07:00
Gleb Smirnoff
e72c522858 divert(4): make it compilable and working without INET
Differential revision:	https://reviews.freebsd.org/D36383
2022-08-30 15:09:21 -07:00
Mark Johnston
465988e9fa NOTES: Update the comment for MCLSHIFT
MFC after:	1 week
2022-08-24 19:59:32 -04:00
Mark Johnston
b0b0e4ee00 NOTES: Update the default MSIZE and MCLSHIFT values
After commit 840327e5dd ("mbuf: Don't support PAGE_SIZE < 4K"), these
defaults were causing LINT kernel builds to fail.

Reported by:	Jenkins
MFC after:	1 week
2022-08-24 19:57:33 -04:00
Navdeep Parhar
2bb28b5f8c cxgbe(4): Update firmwares to 1.27.0.0.
Changes since 1.26.6.0 are listed here.  This list comes from the
Release Notes for "Chelsio Unified Wire 3.17.0.0 for Linux" dated
2022-07-29.

Fixes
-----

BASE:
- Enabled all MA parity interrupt bits.
- Use config file value to override number of rx channel. nrxch=1 was not
  handled in the firmware.
- Replaced read only registers with new registers EDC_H_BIST_USER_WDATA0,
  EDC_H_BIST_USER_WDATA1 and EDC_H_BIST_CMD_LEN to dump the uP memory parity
  error status registers.
- 10G simplex module support enabled.

Obtained from:	Chelsio Communications
MFC after:	1 month
Sponsored by:	Chelsio Communications
2022-08-16 01:06:32 -07:00
Mateusz Guzik
648edd6378 x86: remove MP_WATCHDOG
It does not work with ULE, which is the default scheduler for over a
decade.

Reviewed by:	emaste, kib
Differential Revision:	https://reviews.freebsd.org/D36094
2022-08-11 21:35:32 +00:00
Gleb Smirnoff
f63cb32c19 Retire 4.4BSD raw sockets
Until today the remnants of the original code had provided some aid
in implementation of routing socket and IPSEC key socket.  There were
more obfuscation rather than generalisation with this aid.

A historical reference on the original idea of the raw sockets can
be found in chapter 11 of 4.4BSD System Manager Manual:

https://raw.githubusercontent.com/sergev/4.4BSD-Lite2/master/usr/share/doc/smm/18.net.pdf

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36124
2022-08-11 09:19:36 -07:00
Alexander V. Chernikov
102e6817f0 devd: move all devd notification logic to a separate file.
Currently, subr_bus.c shares logic for (a) maintaining all HW devices
 (e.g. discovery/attach/detach logic) and (b) generic devctl notification
 layer for devices/PMU/GEOM/interfaces/etc).
These two subsystems share really tiny interaction interface, composed of 3
 notification functions. With that in mind, move devctl layer to a
 separate file, establishing a clear notification interface between the
 sub.c bus layer and the provider (devctl).

The primary driver of this change is netlink implementation (D36002).
The idea is to propagate device-level events to netlink as well, so all
 netlink customers can subscribe to these changes.
The long-term goal is to deprecate devctl and to use netlink as the
 kernel<> userland transport provided netlink gets enough traction.

Reviewed by:	imp, markj
Differential Revision: https://reviews.freebsd.org/D36091
MFC after:	1 month
2022-08-10 18:56:01 +00:00
Alexander V. Chernikov
5c4d2252d7 routing: move rtentry and subscription code out of route_ctl.c
route_ctl.c size has grown considerably since initial introduction.
Factor out non-relevant parts:
* all rtentry logic, such as creation/destruction and accessors
 goes to net/route/route_rtentry.c
* all rtable subscription logic goes to net/route/route_subscription.c

Differential Revision: https://reviews.freebsd.org/D36074
MFC after:	1 month
2022-08-10 18:56:01 +00:00
Alexander V. Chernikov
2ce553854c routing: add rib_<add|del>_route_px() functions operating with nexthops.
This change adds public KPI to work with routes using pre-created
 nexthops, instead of using data from addrinfo structures. These
 functions will be later used for adding/deleting kernel-originated
 routes and upcoming netlink protocol.

As a part of providing this KPI, low-level route addition code has been
 reworked to provide more control over route creation or change.
 Specifically, a number of operation flags
 (RTM_F_<CREATE|EXCL|REPLACE|APPEND>) have been added, defining the
 desired behaviour the the route already exists (or not exists). This
 change required some changes in the multipath addition code, resulting
 in moving this code to route_ctl.c, rendering mpath_ctl.c empty.

Differential Revision: https://reviews.freebsd.org/D36073
MFC after:	1 month
2022-08-10 18:56:01 +00:00
Luiz Souza
adff82ea35 Add the PHY driver for the Marvell 88E1512.
This driver supports the auto negotiation mode between the copper and fiber
ports.

This PHY has two independent PHYs (one for copper and other for fiber) but in
this case the functionality is presented as a single PHY for easy management.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-08-09 15:59:22 +02:00
John Baldwin
bbb2f53715 cxgbe: Rename t4_kern_tls.c to t6_kern_tls.c.
This implementation of NIC TLS is specific to T6 adapters.

Sponsored by:	Chelsio Communications
2022-08-08 11:21:53 -07:00
Mark Johnston
f4f56ff43d qat: Rename to qat_c2xxx and remove support for modern chipsets
A replacement QAT driver will be imported, but this replacement does not
support Atom C2xxx hardware.  So, the existing driver will be kept
around to provide opencrypto offload support for those chipsets.

Reviewed by:	pauamma, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35817
2022-07-27 11:10:52 -04:00
Dimitry Andric
e726e71056 Suppress unused variable warning for zfs_fm.c
With clang 15, the following -Werror warning is produced:

    sys/contrib/openzfs/module/zfs/zfs_fm.c:256:6: error: variable 'cnt' set but not used [-Werror,-Wunused-but-set-variable]
            int cnt = 0;
                ^

The 'cnt' variable does not seem to be used for anything, but since this
is contributed code, suppress the warning instead.

MFC after:	3 days
2022-07-26 22:08:14 +02:00
Dimitry Andric
e83ffec3af Suppress -Wstrict-prototypes for several zlib files
Clang 15 is more strict about function definitions not matching
declarations, and zlib has a lot of these, but since it is contributed
code (and in K&R style to boot), suppress those warnings instead.

MFC after:	3 days
2022-07-26 21:25:08 +02:00
Dimitry Andric
3c9a0112ba Fix unused variable warning in acpica's nsaccess.c
With clang 15, the following -Werror warning is produced:

    sys/contrib/dev/acpica/components/namespace/nsaccess.c:452:29: error: variable 'NumCarats' set but not used [-Werror,-Wunused-but-set-variable]
        UINT32                  NumCarats;
                                ^

Here, 'NumCarats' is a variable that is only used when debugging. Since
acpica is contributed code, suppress the warning with a compile flag.

MFC after:	3 days
2022-07-20 21:10:43 +02:00
Mitchell Horne
287d467c5d mac: add new mac_ddb(4) policy
Generally, access to the kernel debugger is considered to be unsafe from
a security perspective since it presents an unrestricted interface to
inspect or modify the system state, including sensitive data such as
signing keys.

However, having some access to debugger functionality on production
systems may be useful in determining the cause of a panic or hang.
Therefore, it is desirable to have an optional policy which allows
limited use of ddb(4) while disabling the functionality which could
reveal system secrets.

This loadable MAC module allows for the use of some ddb(4) commands
while preventing the execution of others. The commands have been broadly
grouped into three categories:
 - Those which are 'safe' and will not emit sensitive data (e.g. trace).
   Generally, these commands are deterministic and don't accept
   arguments.
 - Those which are definitively unsafe (e.g. examine <addr>, search
   <addr> <value>)
 - Commands which may be safe to execute depending on the arguments
   provided (e.g. show thread <addr>).

Safe commands have been flagged as such with the DB_CMD_MEMSAFE flag.

Commands requiring extra validation can provide a function to do so.
For example, 'show thread <addr>' can be used as long as addr can be
checked against the system's list of process structures.

The policy also prevents debugger backends other than ddb(4) from
executing, for example gdb(4).

Reviewed by:	markj, pauamma_gundo.com (manpages)
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D35371
2022-07-18 22:06:15 +00:00
Mitchell Horne
2449b9e5fe mac: kdb/ddb framework hooks
Add three simple hooks to the debugger allowing for a loaded MAC policy
to intervene if desired:
 1. Before invoking the kdb backend
 2. Before ddb command registration
 3. Before ddb command execution

We extend struct db_command with a private pointer and two flag bits
reserved for policy use.

Reviewed by:	markj
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D35370
2022-07-18 22:06:13 +00:00
Mark Johnston
1424f65bbc vm_pager: Remove the default pager
It's unused now.  Keep the OBJ_DEFAULT identifier, but make it an alias
of OBJT_SWAP for the benefit of out-of-tree code.

Reviewed by:	alc, imp, kib
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35790
2022-07-17 07:09:48 -04:00
Brooks Davis
3bf6636512 cddl/*: add a WITH(OUT)_DTRACE option
Add an option to enable/disable DTrace without disabling ZFS.  New
architectures such as CHERI may support ZFS before they support DTrace
and the old model of WITHOUT_CDDL disabling both wasn't helpful.

For compatiblity, the CDDL option remains and WITHOUT_CDDL implies
WITHOUT_DTRACE.  WITHOUT_DTRACE also implies WITHOUT_CTF.

As part of this change, largely convert cddl/*/Makefile to using the
more compact SUBDIR.${MK_<FOO>}+= form rather than using intermediate
variables.

Reviewed by:	markj
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D35718
2022-07-06 14:03:48 +01:00
Bjoern A. Zeeb
fbb5cb66f7 dwc3: add ACPI attachment
Split the current FDT-only implementation up into an FDT and an
ACPI part reusing and sharing as much code as possible (thanks mw!).

This makes the Synopsis XHCI root hubs attach correctly on SolidRun's
HoenyComb instead of just the generic XHCI root and this means we
are also doing proper chip setup and applying the quirk needed there [1].

There is one problem with ACPI attachment in that it uses the generic
XHCI PNP ID.  So we need to do extra checks in order to not claim
all xhci, which means we check for a known quirk to be present
in acpi_probe.  Long term this isn't scaling and this was discussed
in SolidRun's Discord Channel in 2021 with the intend that "jnettlet"
will take this to a steering committee.  Since then ACPI has kind-of
become a technology non grata (due to not getting changes into Linux
timely) so it is unclear if this will ever happen.  If there will be
further hardware with dwc3/ACPI we should go and make sure this problem
gets solved.

[1] 24698f90b7/Silicon/NXP/LX2160A/AcpiTables/Dsdt/Usb.asl

Reviewed by:		manu, mw
MFC after:		10 days
Differential Revision:	https://reviews.freebsd.org/D32256
2022-07-06 11:26:34 +00:00
Bjoern A. Zeeb
97dbd37753 pca954x: harmonize pca9547 and pca954x and add pca9540 support
The two implementations for the pca9548 switch and the pca9547 mux
seemed close enough so we can put them together and with a bit more
abstraction add pca9540 support.

While here apply a bit of consistency in variable and driver naming and
use device_has_property instead of the FDT-only OF_ variant.

This disconnects pca9547 from the build but does not yet delete it.

MFC after:	2 weeks
Reviewed by:	mmel (earlier version), avg
Differential Revision: https://reviews.freebsd.org/D35701
2022-07-04 19:12:01 +00:00
Bjoern A. Zeeb
8154df37a5 arm64: NXP add LS1088a clockgen support
Add a driver for NXP LS1088a clockgen support which passes
configuration information to QorIQ clockgen class.
The implementaiton started off as copy of ls1028 support and was
adjusted accordingly.

Reviewed by:	dgr_semihalf.com (earlier), mmel
MFC after:	1 week
Sponsored by:	Traverse Technologies (providing Ten64 HW for testing)
Differential Revision: https://reviews.freebsd.org/D35617
2022-07-02 16:27:23 +00:00
Dag-Erling Smørgrav
038405f32f Enable CRC64 checksums in xz.
Reviewed by:	imp
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D35668
2022-06-29 20:25:52 +00:00
Kristof Provost
ab91feabcc ovpn: Introduce OpenVPN DCO support
OpenVPN Data Channel Offload (DCO) moves OpenVPN data plane processing
(i.e. tunneling and cryptography) into the kernel, rather than using tap
devices.
This avoids significant copying and context switching overhead between
kernel and user space and improves OpenVPN throughput.

In my test setup throughput improved from around 660Mbit/s to around
2Gbit/s.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34340
2022-06-28 11:33:10 +02:00
Bjoern A. Zeeb
d78bef0ebe hwpmc: further fix build (__diagused/debug/missing files entries)
Fix builds after 1459a22787 and
59191f3573 by using __diagused
for variables only used in KASSERT().
In addition remove two debug lines that look like a copy and paste error
from dmc620 to cmn600.
Further add the newly introduced files to sys/confg/files.arm64 as well
so that LINT compiles without missing symbols.
2022-06-27 01:36:52 +00:00
Andrew Turner
52f6e63ab3 Fix the zfs build for arm64
Remove -mgeneral-regs-only when building the arm64 blake3 code. It
uses simd instructions so will use non-general purpose registers.

Sponsored by:	The FreeBSD Foundation
2022-06-24 14:50:12 +01:00
Martin Matuska
d1aefbc04c zfs: fix static module build broken in 1f1e2261e 2022-06-23 19:44:38 +02:00
Ed Maste
a4d55999dc Remove ISA sound cards from NOTES
Fixes:		df51e63eb5 ("Retire snd_ad1816 ISA sound card driver")
Fixes:		aa83e9b189 ("Retire snd_ess ISA sound card driver")
Fixes:		754decef38 ("Retire snd_gusc ISA sound card driver")
Fixes:		5126e5eeeb ("Retire snd_mss ISA sound card driver")
Fixes:		716924cb48 ("Retire snd_sbc ISA sound card driver")

Sponsored by:	The FreeBSD Foundation
2022-06-21 16:33:00 -04:00
Ed Maste
716924cb48 Retire snd_sbc ISA sound card driver
Along with the snd_sb8 and snd_sb16 drivers.  They supported ISA
Creative Sound Blaster and compatible sound cards.

Note that isa/sb.h is not removed, as it is still used by some PCI
sound card drivers.

ISA sound card drivers are deprecated as discussed on the current[1] and
stable[2] mailing lists.  Deprecation notices were added in e39ec8933b
and MFCd to stable branches.

Driver removals are being committed individually so that specific
drivers can be restored if necessary (either in FreeBSD or by downstream
projects).

[1] https://lists.freebsd.org/archives/freebsd-current/2022-March/001680.html
[2] https://lists.freebsd.org/archives/freebsd-stable/2022-March/000585.html

Reviewed by:	mav
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34671
2022-06-21 14:50:04 -04:00
Ed Maste
5126e5eeeb Retire snd_mss ISA sound card driver
The snd_mss driver supported Microsoft Sound System sound cards.

ISA sound card drivers are deprecated as discussed on the current[1] and
stable[2] mailing lists.  Deprecation notices were added in e39ec8933b
and MFCd to stable branches.

Driver removals are being committed individually so that specific
drivers can be restored if necessary (either in FreeBSD or by downstream
projects).

[1] https://lists.freebsd.org/archives/freebsd-current/2022-March/001680.html
[2] https://lists.freebsd.org/archives/freebsd-stable/2022-March/000585.html

Reviewed by:	mav
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	Thttps://reviews.freebsd.org/D34671
2022-06-21 14:50:04 -04:00
Ed Maste
754decef38 Retire snd_gusc ISA sound card driver
snd_gusc supported the Gravis UltraSound MAX and UltraSound PnP sound
cards.

ISA sound card drivers are deprecated as discussed on the current[1] and
stable[2] mailing lists.  Deprecation notices were added in e39ec8933b
and MFCd to stable branches.

Driver removals are being committed individually so that specific
drivers can be restored if necessary (either in FreeBSD or by downstream
projects).

[1] https://lists.freebsd.org/archives/freebsd-current/2022-March/001680.html
[2] https://lists.freebsd.org/archives/freebsd-stable/2022-March/000585.html

Reviewed by:	mav
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34671
2022-06-21 14:50:04 -04:00
Ed Maste
aa83e9b189 Retire snd_ess ISA sound card driver
snd_ess supported sound cards using the ESS 18xx chipset.

ISA sound card drivers are deprecated as discussed on the current[1] and
stable[2] mailing lists.  Deprecation notices were added in e39ec8933b
and MFCd to stable branches.

Driver removals are being committed individually so that specific
drivers can be restored if necessary (either in FreeBSD or by downstream
projects).

[1] https://lists.freebsd.org/archives/freebsd-current/2022-March/001680.html
[2] https://lists.freebsd.org/archives/freebsd-stable/2022-March/000585.html

Reviewed by:	mav
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34671
2022-06-21 14:50:04 -04:00
Ed Maste
df51e63eb5 Retire snd_ad1816 ISA sound card driver
snd_ad1816 supported ISA sound cards based on the Analog Devices
AD1816A "SoundPort® Controller".

ISA sound card drivers are deprecated as discussed on the current[1] and
stable[2] mailing lists.  Deprecation notices were added in e39ec8933b
and MFCd to stable branches.

Driver removals are being committed individually so that specific
drivers can be restored if necessary (either in FreeBSD or by downstream
projects).

[1] https://lists.freebsd.org/archives/freebsd-current/2022-March/001680.html
[2] https://lists.freebsd.org/archives/freebsd-stable/2022-March/000585.html

Reviewed by:	mav
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34671
2022-06-21 14:50:04 -04:00
John Baldwin
6ab35c78fb newvers.sh: Don't use return to exit.
Commit acfb506b3d replaced an exit 0 when using -V with a return
instead.  FreeBSD's sh treats a return outside of a function like
exit, but this is a non-portable extension.  Other Bourne shells only
permit return to be used within a function and continue execution
(possibly with a warning).

To fix, don't reuse VARS_ONLY (which is intended to be set by other
scripts before sourcing newvers.sh directly) and instead use a new
variable (VARS_ONLY_EXIT) to restore the use of exit for the
non-sourced case.

Reviewed by:	emaste
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35481
2022-06-14 10:51:39 -07:00
John Baldwin
628a4156a7 firmware: Map '@' in filenames to '_' in symbols.
'@' is not a valid character in symbol names and can sometimes appear
in path names.

Reviewed by:	imp, markj
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35480
2022-06-14 10:50:51 -07:00
Brooks Davis
d07600c563 amd64: symlink i386 includes into build dir
By creating an i386 symlink, this allows code compiled with -m32 to
build (32-bit vdso and linux bits) when -m32 support requires files
in the i386 hierarchy.

Reviewed by:	jhb, imp
2022-06-13 18:35:38 +01:00
Ed Maste
a7bd57de86 Sort SPLIT_KERNEL_DEBUG correctly in kern.opts.mk
Fixes:		e3709cfe6a ("Add SPLIT_KERNEL_DEBUG knob")
2022-06-09 10:39:52 -04:00
Ed Maste
e3709cfe6a Add SPLIT_KERNEL_DEBUG knob
Prior to 9b6edf364e WITHOUT_KERNEL_SYMBOLS split kernel debug data
into standalone debug files at build time, but did not install those
files.  As of 9b6edf364e it stopped splitting the debug data, leaving
it in the kernel and modules (the default kernel configs include
DEBUG=-g).

Revert 9b6edf364e and introduce a new build-time SPLIT_KERNEL_DEBUG
knob, as some people rely on the pre-9b6edf364eb0 WITHOUT_KERNEL_SYMBOLS
behaviour and that was imp's original intent.

PR:		264433
Reviewed by:	eugen, imp
MFC after:	3 weeks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35437
2022-06-08 17:14:46 -04:00
Mitchell Horne
acdfbc6cbe irdma: fix LINT-NOIP/NOINET/NOINET6 builds
This module depends on the presence of both INET and INET6 options in
order to compile.

Reviewed by:	erj
Fixes:	cdcd52d41e ("irdma: Add RDMA driver for Intel(R) Ethernet...")
Differential Revision:	https://reviews.freebsd.org/D35343
2022-05-30 17:47:55 -03:00
Bartosz Sobczak
cdcd52d41e
irdma: Add RDMA driver for Intel(R) Ethernet Controller E810
This is an initial commit for RDMA FreeBSD driver for Intel(R) Ethernet
Controller E810, called irdma.  Supporting both RoCEv2 and iWARP
protocols in per-PF manner, RoCEv2 being the default.

Testing has been done using krping tool, perftest, ucmatose, rping,
ud_pingpong, rc_pingpong and others.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	#manpages (pauamma_gundo.com) [documentation]
MFC after:	1 week
Relnotes:	yes
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D34690
2022-05-23 16:52:49 -07:00
Eric Joyner
8a13362d49
ice(4): Add RDMA Client Interface
This allows the "irdma" driver to communicate with the ice(4)
driver to allow it access to the underlying device's hardware
resources as well as synchronize access to shared resources.

This interface already existed in the standalone out-of-tree
1.34.2 driver; this commit adds and enables it in the in-kernel
driver.

Note:

Adds hack to module Makefile to compile interface/.m files

These are required for the RDMA client interface, but they don't
build as-is like the normal .c files. The source directory doesn't
seem to be included by default, so add lines that specifically
add them as libraries so that ice_rdma.h can be found and the
interface files will compile.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

MFC after:	1 week
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D30889
2022-05-23 16:23:49 -07:00
Andrew Turner
88ac318759 Support LSE atomics in the arm64 casue* functions
As with atomic(9) use the ARMv8.1 Large System Extension atomic
instructions to implement the userspace compare and swap functions.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35234
2022-05-19 11:30:21 +01:00
Dimitry Andric
0817c8dc2a Avoid adding -d to kernel module link command lines for lld >= 14
Since 0b3178a45c we have added '-d' to the link command line for
kernel modules, so if any unexpected common symbols turn up (even though
we use -fno-common in CFLAGS), storage will be allocated in in the
module itself.

However, with lld this option did not have any effect since ~2017, and
as of lld 14 it warns: "-d, -dc, -dp, and --[no-]define-common will be
removed. See https://github.com/llvm/llvm-project/issues/53660"

Add a linker type and version check, to avoid adding the option for lld
14 and later.

Reported by:	bz
MFC after:	2 weeks
2022-05-14 22:07:12 +02:00
Ruslan Bukin
a5ec261a7c Add FDT attachment driver for ARM System MMU v3.2 controller.
Tested on ARM Morello Board.

Sponsored by:	UKRI
2022-05-07 11:18:35 +01:00
John Baldwin
0b377a49fa FB_INSTALL_CDEV: Remove this option and related code.
This option was never enabled in GENERIC and does not appear to work
(the cdevsw is stored in a global array but never passed to make_dev
to be associated with a character device).

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D35008
2022-04-21 10:29:14 -07:00
John Baldwin
8b83d7e0ee Make -Wunused-but-set-variable a fatal error for clang 13+ for kernel builds.
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D34949
2022-04-18 16:06:27 -07:00