Commit graph

4365 commits

Author SHA1 Message Date
Kristof Provost
c3d03672e1 pf: syncookie support
Import OpenBSD's syncookie support for pf. This feature help pf resist
TCP SYN floods by only creating states once the remote host completes
the TCP handshake rather than when the initial SYN packet is received.

This is accomplished by using the initial sequence numbers to encode a
cookie (hence the name) in the SYN+ACK response and verifying this on
receipt of the client ACK.

Reviewed by:	kbowling
Obtained from:	OpenBSD
MFC after:	1 week
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D31138

(cherry picked from commit 8e1864ed07)
2021-07-27 09:42:25 +02:00
Martin Matuska
06887e0686 zfs: update zfs_gitrev.h
From now on, every merge from vendor/openzfs/zfs-2.1-release should come
with an updated zfs_config.h and zfs_gitrev.h

(direct commit)
2021-07-23 03:29:33 +02:00
Emmanuel Vadot
4e6f174686 arm: allwinner: dtb: Add overlays to disable SD/MMC node
Useful for dev

Sponsored by:	Diablotin Systems

(cherry picked from commit bc805293d8)
2021-07-22 19:29:21 +02:00
Emmanuel Vadot
4187041f70 arm64: rockchip: Add some DTSO to disable sd/mmc
This helps during developement to reduce the number of mmc controller.

(cherry picked from commit eb09408085)
2021-07-22 19:29:20 +02:00
Emmanuel Vadot
c62869cdb7 sdhci_fdt: Add gpio_if.h to the source
Otherwise if we compile a kernel without gpio support this file isn't compiled.
Also it's needed so it's good to list all deps.

PR:	256756
(cherry picked from commit bf7b542e02)
2021-07-22 19:27:17 +02:00
Emmanuel Vadot
4292390bd6 modules: Only build sdhci_fdt for arm and arm64
Other FDT platform (like powerpc64* or riscv64) don't have gpio built
by default so just compile the module for those two arches.

Fixes:	9e08f82058 ("modules: Add sdhci_fdt module")
(cherry picked from commit 0b426a1c2c)
2021-07-22 18:51:33 +02:00
Emmanuel Vadot
f13f43e2ba modules: Add sdhci_fdt module
This is a module for sdhci on fdt system

(cherry picked from commit 9e08f82058)
2021-07-22 18:51:32 +02:00
Martin Matuska
e1946a699d zfs: merge openzfs/zfs@4f92fe0f5 (zfs-2.1-release) into stable/13
OpenZFS release 2.1.0

Version bump only, no changes in code.

Obtained from:	OpenZFS
OpenZFS commit:	4f92fe0f5c
OpenZFS tag:	zfs-2.1.0
Relnotes:	yes
2021-07-10 17:59:52 +02:00
Martin Matuska
a4c1676749 zfs: update zfs_config.h to match current OpenZFS version (4f92fe0f5)
TBD: fetch(3) support for keylocation=http(s)://

(direct commit)
2021-07-10 17:56:31 +02:00
Martin Matuska
7f101ca7d1 zfs: merge openzfs/zfs@508fff0e4 (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #12253 module/zfs: simplify ddt_stat_add() loop
  #12280 Help compiller optimize out abd_verify()
  #12288 Avoid 64bit division in multilist index functions

Obtained from:	OpenZFS
OpenZFS commit:	508fff0e4b
OpenZFS tag:	zfs-2.1.0-rc8
2021-06-30 10:56:20 +02:00
Martin Matuska
363a2f5661 zfs: merge openzfs/zfs@aee26af27 (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #12172 Use wmsum for arc, abd, dbuf and zfetch statistics
  #12227 Revert Consolidate arc_buf allocation checks
  #12273 zfs_metaslab_mem_limit should be 25 instead of 75
  #12266 Fix flag copying in resume case
  #12276 Update cache file when setting compatibility property

Obtained from:	OpenZFS
OpenZFS commit:	aee26af277
2021-06-26 13:38:37 +02:00
Martin Matuska
25302a721f zfs: merge openzfs/zfs@9a865b7fb (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #11904 libspl: implement atomics in terms of atomics

Obtained from:	OpenZFS
OpenZFS commit:	9a865b7fb7
2021-06-22 09:18:11 +02:00
Mark Johnston
df57775d7a hyperv: Fix vmbus after the i386 4/4 split
The vmbus ISR needs to live in a trampoline.  Dynamically allocating a
trampoline at driver initialization time poses some difficulties due to
the fact that the KENTER macro assumes that the offset relative to
tramp_idleptd is fixed at static link time.  Another problem is that
native_lapic_ipi_alloc() uses setidt(), which assumes a fixed trampoline
offset.

Rather than fight this, move the Hyper-V ISR to i386/exception.s.  Add a
new HYPERV kernel option to make this optional, and configure it by
default on i386.  This is sufficient to make use of vmbus(4) after the
4/4 split.  Note that vmbus cannot be loaded dynamically and both the
HYPERV option and device must be configured together.  I think this is
not too onerous a requirement, since vmbus(4) was previously
non-functional.

Reported by:	Harry Schmalzbauer <freebsd@omnilan.de>
Tested by:	Harry Schmalzbauer <freebsd@omnilan.de>
Reviewed by:	whu, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 97993d1ebf)
2021-06-21 21:09:17 -04:00
Martin Matuska
d4b4969967 zfs: merge openzfs/zfs@3de7aeb68 (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #12054 Avoid deadlock when removing L2ARC devices under I/O
  #12221 vdev_draid_min_asize() ignores reserved space

Obtained from:	OpenZFS
OpenZFS commit:	3de7aeb68a
2021-06-20 15:16:16 +02:00
Marko Zec
4715d948c5 Introduce DXR as an IPv4 longest prefix matching / FIB module
DXR maintains compressed lookup structures with a trivial search
procedure.  A two-stage trie is indexed by the more significant bits of
the search key (IPv4 address), while the remaining bits are used for
finding the next hop in a sorted array.  The tradeoff between memory
footprint and search speed depends on the split between the trie and
the remaining binary search.  The default of 20 bits of the key being
used for trie indexing yields good performance (see below) with
footprints of around 2.5 Bytes per prefix with current BGP snapshots.

Rebuilding lookup structures takes some time, which is compensated for by
batching several RIB change requests into a single FIB update, i.e. FIB
synchronization with the RIB may be delayed for a fraction of a second.
RIB to FIB synchronization, next-hop table housekeeping, and lockless
lookup capability is provided by the FIB_ALGO infrastructure.

DXR works well on modern CPUs with several MBytes of caches, especially
in VMs, where is outperforms other currently available IPv4 FIB
algorithms by a large margin.

Reviewed by:	melifaro
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D29821

(cherry picked from commit 2aca58e16f)
2021-06-17 12:07:05 +02:00
Martin Matuska
b0c251b0de zfs: merge openzfs/zfs@c3b60eded (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #12015 Replace zstreamdump with zstream link
  #12046 Improve scrub maxinflight_bytes math.
  #12052 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI
  #12072 Let zfs diff be more permissive
  #12091 libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat
  #12104 Reminder to update boot code after zpool upgrade
  #12114 Introduce write-mostly sums
  #12125 Modernise all (most) remaining .TH manpages
  #12145 More aggsum optimizations
  #12149 Multiple man-pages: Move to appropriate section
  #12158 Re-embed multilist_t storage
  #12177 Livelist logic should handle dedup blkptrs
  #12196 Unify manpage makefiles, move pages to better sexions, revisit some
  #12212 Remove pool io kstats

Obtained from:	OpenZFS
OpenZFS commit:	c3b60ededa
OpenZFS tag:	zfs-2.1.0-rc7
2021-06-13 05:43:03 +02:00
Martin Matuska
04c4bd7f7b zfs: merge openzfs/zfs@7d9f3ef0e (zfs-2.1-release) into stable/13
Notable upstream pull request merges:
  #11710 Allow zfs to send replication streams with missing snapshots
  #11786 Ratelimit deadman zevents as with delay zevents
  #11813 Allow pool names that look like Solaris disk names
  #11822 Atomically check and set dropped zevent count
  #11822 Don't scale zfs_zevent_len_max by CPU count
  #11837 zfs get -p only outputs 3 columns if "clones" property is empty
  #11849 Use dsl_scan_setup_check() to setup a scrub
  #11861 Improvements to the 'compatibility' property
  #11862 cmd/zfs receive: allow dry-run (-n) to check property args
  #11864 receive: don't fail inheriting (-x) properties on wrong dataset type
  #11877 Combine zio caches if possible
  #11881 FreeBSD: use vnlru_free_vfsops if available
  #11883 FreeBSD: add support for lockless symlink lookup
  #11884 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr
  #11896 Fix crash in zio_done error reporting
  #11905 zfs-send(8): Restore sorting of flags
  #11926 FreeBSD: damage control racing .. lookups in face of mkdir/rmdir
  #11938 Fix AVX512BW Fletcher code on AVX512-but-not-BW machines
  #11966 Scale worker threads and taskqs with number of CPUs
  #11997 FreeBSD: Don't force xattr mount option
  #11997 FreeBSD: Use SET_ERROR to trace xattr name errors
  #11998 Simplify/fix dnode_move() for dn_zfetch
  #12003 FreeBSD: Initialize/destroy zp->z_lock
  #12010 Fix dRAID self-healing short columns
  #12033 Revert "Fix raw sends on encrypted datasets when copying back snapshots"
  #12040 Reinstate the old zpool read label logic as a fallback
  #12049 FreeBSD: avoid memory allocation in arc_prune_async
  #12061 Fix dRAID sequential resilver silent damage handling
  #12077 FreeBSD: Retry OCF ENOMEM errors.
  #12088 Propagate vdev state due to invalid label corruption
  #12097 FreeBSD: Update dataset_kstats for zvols in dev mode

Obtained from:	OpenZFS
OpenZFS commit:	7d9f3ef0ef
OpenZFS tag:	2.1.0-rc6
2021-06-08 17:01:18 +02:00
Kristof Provost
f9b057eaf6 pf: Introduce nvlist variant of DIOCADDRULE
This will make future extensions of the API much easier.
The intent is to remove support for DIOCADDRULE in FreeBSD 14.

Reviewed by:	markj (previous version), glebius (previous version)
MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29557

(cherry picked from commit 5c62eded5a)
2021-05-07 10:15:41 +02:00
Vladimir Kondratyev
91e562169c hidmap: add missing opt_hid.h to module Makefile
Reported by:	pstef
2021-04-30 23:12:33 +03:00
Martin Matuska
049d49e40a zfs: merge openzfs/zfs@3522f57b6 (master)
Notable upstream pull request merges:
  #11742 When specifying raidz vdev name, parity count should match
  #11744 Use a helper function to clarify gang block size
  #11771 Support running FreeBSD buildworld on Arm-based macOS hosts

This is the last update that will be MFCed into stable/13.

From now on, the tracking of OpenZFS branches will be different:
- main continues tracking openzfs/zfs/master
- stable/13 is going to track openzfs/zfs/zfs-2.1-release

Obtained from:	OpenZFS

(cherry picked from commit 6db169e920)
2021-04-22 17:03:06 +02:00
Vladimir Kondratyev
99bc385243 hid: add opt_hid.h to modules that use HID_DEBUG
Submitted by:	Greg V <greg_AT_unrelenting_DOT_technology>
Reviewed by:	imp, wulf
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D28995

(cherry picked from commit 6241b57131)
2021-04-12 00:48:51 +03:00
Ka Ho Ng
d7ffa208d9 AMD-vi: Fix IOMMU device interrupts being overridden
Currently, AMD-vi PCI-e passthrough will lead to the following lines in
dmesg:
"kernel: CPU0: local APIC error 0x40
ivhd0: Error: completion failed tail:0x720, head:0x0."

After some tracing, the problem is due to the interaction with
amdvi_alloc_intr_resources() and pci_driver_added(). In ivrs_drv, the
identification of AMD-vi IVHD is done by walking over the ACPI IVRS
table and ivhdX device_ts are added under the acpi bus, while there are
no driver handling the corresponding IOMMU PCI function. In
amdvi_alloc_intr_resources(), the MSI intr are allocated with the ivhdX
device_t instead of the IOMMU PCI function device_t. bus_setup_intr() is
called on ivhdX. the IOMMU pci function device_t is only used for
pci_enable_msi(). Since bus_setup_intr() is not called on IOMMU pci
function, the IOMMU PCI function device_t's dinfo->cfg.msi is never
updated to reflect the supposed msi_data and msi_addr. So the msi_data
and msi_addr stay in the value 0. When pci_driver_added() tried to loop
over the children of a pci bus, and do pci_cfg_restore() on each of
them, msi_addr and msi_data with value 0 will be written to the MSI
capability of the IOMMU pci function, thus explaining the errors in
dmesg.

This change includes an amdiommu driver which currently does attaching,
detaching and providing DEVMETHODs for setting up and tearing down
interrupt. The purpose of the driver is to prevent pci_driver_added()
from calling pci_cfg_restore() on the IOMMU PCI function device_t.
The introduction of the amdiommu driver handles allocation of an IRQ
resource within the IOMMU PCI function, so that the dinfo->cfg.msi is
populated.

This has been tested on EPYC Rome 7282 with Radeon 5700XT GPU.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	jhb
Approved by:	philip (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D28984

(cherry picked from commit 74ada297e8)
2021-04-07 18:55:38 +08:00
Martin Matuska
93d1c189bc zfs: merge OpenZFS master-891568c99
Notable upstream pull request merges:
  #11652 Split dmu_zfetch() speculation and execution parts
  #11682 Fix zfs_get_data access to files with wrong generation
  #11735 Clean up RAIDZ/DRAID ereport code
  #11737 Initialize metaslab range trees in metaslab_init
  #11739 FreeBSD: make seqc asserts conditional on replay
  #11763 Allow setting bootfs property on pools with indirect vdevs
  #11767 FreeBSD: Fix memory leaks in kstats

Obtained from:	OpenZFS

(cherry picked from commit f9693bef8d)
2021-04-04 15:19:09 +02:00
Martin Matuska
cf2a726434 zfs: merge OpenZFS master-9305ff2ed
Notable upstream pull request merges:
  #11153 Scalable teardown lock for FreeBSD
  #11651 Don't bomb out when using keylocation=file://
  #11667 zvol: call zil_replaying() during replay
  #11683 abd_get_offset_struct() may allocate new abd
  #11693 Intentionally allow ZFS_READONLY in zfs_write
  #11716 zpool import cachefile improvements
  #11720 FreeBSD: Clean up zfsdev_close to match Linux
  #11730 FreeBSD: bring back possibility to rewind the
         checkpoint from bootloader

Obtained from:	OpenZFS

(cherry picked from commit 9db44a8e5d)
2021-04-04 15:18:45 +02:00
Dmitry Chagin
f5209bef0f Get rid of i386 ref here as linux64 is a 64-bit module.
Reviewed By:		emaste, imp
Differential Revision:	https://reviews.freebsd.org/D29412

(cherry picked from commit 88588c4b76)
2021-04-01 11:03:35 +03:00
Hans Petter Selasky
773811507d MFC ebe5cf355d:
Implement basic support for allocating memory from a specific numa node
in the LinuxKPI.

Differential Revision:	https://reviews.freebsd.org/D29077
Reviewed by:	markj@ and kib@
Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit ebe5cf355d)
2021-03-23 11:50:47 +01:00
Alexander Motin
0cb06bcc54 Include ccompile.h after opt_global.h.
This restores INVARIANTS enabling ZFS_DEBUG when built as module.

Discussed with:	freqlabs
MFC after:	1 week

(cherry picked from commit 8ea35c45d5)
2021-03-21 20:54:06 -04:00
Scott Long
b65d2c31b1 base: remove if_wg(4) and associated utilities, manpage
After length decisions, we've decided that the if_wg(4) driver and
   related work is not yet ready to live in the tree.  This driver has
   larger security implications than many, and thus will be held to
   more scrutiny than other drivers.

Requested by: secteam
Approved by: re
2021-03-18 07:07:56 +00:00
Martin Matuska
29805b312c zfs: update openzfs version reference to bedbc13da
It was missed in the latest merge.

(cherry picked from commit 6781b8a32e)
2021-03-10 02:58:21 +01:00
Martin Matuska
57b9b81894 zfs: merge OpenZFS master-9312e0fd1
Notable upstream changes:
  778869fa1 Fix reporting of mount progress
  e7adccf7f Disable use of hardware crypto offload drivers on FreeBSD
  03e02e5b5 Fix checksum errors not being counted on repeated repair
  64e0fe14f Restore FreeBSD resource usage accounting
  11f2e9a49 Fix panic if scrubbing after removing a slog device

(cherry picked from commit ba27dd8be8)
2021-03-10 02:53:32 +01:00
Martin Matuska
e295b9d9f5 zfs: bump version and install new share files
- bump version to 2.0.0-FreeBSD_gbf156c966
- install definition files for the new "-o compatibility" option
  to "zpool create"

MFC after:	2 weeks

(cherry picked from commit 10f57cb98f)
2021-03-10 02:26:35 +01:00
Martin Matuska
21b12f3e45 zfs: merge OpenZFS master-436ab35a5
- speed up writing to ZFS pools without ZIL devices (aa755b3)
- speed up importing ZFS pools (2d8f72d, a0e0199, cf0977a)
...

Reviewed by:		mjg (partial)
Tested by:		pho
Differential Revision:	https://reviews.freebsd.org/D28677

(cherry picked from commit 184c1b9439)
2021-03-10 02:24:58 +01:00
Eric Joyner
1da549169d ice(4): Update to version 0.28.1-k
This updates the driver to align with the version included in
the "Intel Ethernet Adapter Complete Driver Pack", version 25.6.

There are no major functional changes; this mostly contains
bug fixes and changes to prepare for new features. This version
of the driver uses the previously committed ice_ddp package
1.3.19.0.

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

Tested by:	jeffrey.e.pieper@intel.com
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D28640

(cherry picked from commit d08b8680e1)
2021-03-09 14:35:54 -08:00
Eric Joyner
a02640c79e ice_ddp: Update package file to 1.3.19.0
This package is intended to be used with ice(4) version 0.28.1-k.
That update will happen in a forthcoming commit.

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

(cherry picked from commit a7ac518bff)
2021-03-09 14:35:50 -08:00
Lutz Donnerhacke
522a0b7d02 netgraph/ng_vlan_rotate: IEEE 802.1ad VLAN manipulation netgraph type
This node is part of an A10-NSP (L2-BSA) development.

Carrier networks tend to stack three or more tags for internal
purposes and therefore hiding the service tags deep inside of the
stack. When decomposing such an access network frame, the processing
order is typically reversed: First distinguish by service, than by
other means.

This new netgragh node allows to bring the relevant VLAN in front (to
the out-most position). This way other netgraph nodes (like ng_vlan)
can operate on this specific type.

Reviewed by:	manpages (gbe), brueffer (manpages), kp
Relnotes:	yes
Sponsored by:	IKS Service GmbH
Differential Revision: https://reviews.freebsd.org/D22076

(cherry picked from commit cfd6422a52)
2021-02-25 09:04:24 +01:00
Martin Matuska
2126962573 zfs: restore FreeBSD resource usage accounting
With the switch to OpenZFS 2.0 the platform-dependent resource
usage accounting code got missing.

Patch author:	Ryan Moeller <freqlabs@FreeBSD.org>

Obtained from:	openzfs/zfs@64e0fe14ff
MFS after:	3 days

(direct commit)
2021-02-22 22:20:28 +01:00
Alan Somers
8874f305d8 ZFS: fix assertions with INVARIANTS
AFAICT, this was an oversight from
9e5787d228 (svn r364746).  That revision
inadvertently disabled assertions unconditionally.

Reviewed by:	freqlabs
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D28256

(cherry picked from commit 174a7e578a)
2021-02-12 22:03:19 -07:00
Martin Matuska
9c829699aa zfs: update zfs_config.h to match OpenZFS gf11b09dec
Update zfs_config.h to match latest merge in FreeBSD

The version string is declared as 2.0.0-FreeBSD_gf11b09dec to provide
more information about the loaded module:
- the OpenZFS version in base is 2.0
- we are using the in tree-module ("FreeBSD")
- the last merged OpenZFS git revision ("gf11b09dec")

With future merges the git revision tag should be updated.
As we are merging from OpenZFS master branch and already include features
like dRAID, referencing patchlevel releases (2.0.1, 2.0.2) is pointless.

Reviewed by:	freqlabs
Differential Revision:	https://reviews.freebsd.org/D28447

(cherry picked from commit 8fb966790e)
2021-02-04 18:40:55 +01:00
Bjoern A. Zeeb
ff119f7c4a LinuxKPI: implement devres() framework parts and two examples
This code implements a version of the devres framework found
working for various iwlwifi use cases and also providing functions
for ttm_page_alloc_dma.c from DRM.

Part of the framework replicates the consumed KPI, while others
are internal helper functions.

In addition the simple devm_k*malloc() consumers were implemented
and kvasprintf() was enhanced to also work for the devm_kasprintf()
case.
Addmittingly lkpi_devm_kmalloc_release() could be avoided but for
the overall understanding of the code and possible memory tracing
it may still be helpful.

Further devsres consumer are implemented for iwlwifi but will follow
later as the main reason for this change is to sort out overlap with
DRM.

Sponsored-by:	The FreeBSD Foundation
Obtained-from:	bz_iwlwifi
MFC After:	3 days
Reviewed-by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D28189

(cherry picked from commit fa765ca73e)
2021-02-02 11:51:26 +00:00
Bjoern A. Zeeb
ffd05df717 LinuxKPI: add firmware loading support
Implement linux firmware KPI compat code.
This includes: request_firmware() request_firmware_nowait(),
request_firmware_direct(), firmware_request_nowarn(),
and release_firmware().

Given we will try to map requested names from natively ported
or full-linuxkpi-using drivers to a firmware(9) auto-loading
name format (.ko file name and image name matching),
we quieten firmware(9) and print success or failure (unless
the _nowarn() version was called) in the linuxkpi implementation.
At the moment we try up-to 4 different naming combinations,
with path stripped, original name, and requested name with '/'
or '.' replaced.

We do not currently defer loading in the "nowait" case.

Sponsored-by:	The FreeBSD Foundation
Sponsored-by:	Rubicon Communications, LLC ("Netgate")
		(firmware(9) nowarn update from D27413)
MFC after:	3 days
Reviewed by:	kib, manu (looked at older versions)
Differential Revision:	https://reviews.freebsd.org/D27414

(cherry picked from commit a6c2507d1b)
(cherry picked from commit 4a26380ba6)
2021-02-02 11:50:38 +00:00
Oleksandr Tymoshenko
f76393a630 armv8crypto: add AES-GCM support
Add support for AES-GCM using OpenSSL's accelerated routines.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D27454
Sponsored by:	Ampere Computing
Submitted by:	Klara, Inc.
Approved by:	re (kib)

(cherry picked from commit ed9b7f4414)
2021-01-22 22:34:37 -08:00
Jessica Clarke
513c5cd827 linux64: Don't pass unnecessary -S and -g to objcopy
Since we use --input-type binary these options are rather meaningless. Both
binutils and elftoolchain ignore the option in this case, but LLVM does not,
and instead strips all symbols from the output file, causing missing symbols at
run time if building with llvm-objcopy. Thus simply remove the options; the
linux module has never included them for building its VDSO (added in r283407),
but for some reason the original commit of linux64 (r283424) added them.

These should however eventually be changed to use template assembly files as is
now done for firmware and MFS_IMAGE.

Reviewed by:	emaste, trasz
Differential Revision:	https://reviews.freebsd.org/D27740
2021-01-21 01:54:52 +00:00
Jessica Clarke
32cb85d0f1 Build VirtIO modules on all architectures
Currently only amd64, i386 and powerpc build VirtIO modules, yet all other
architectures have at least one kernel configuration that includes the
transport drivers, and so they lack drivers for all the devices they don't
statically compile into the kernel. Instead, enable the build everywhere so all
architectures have the full set of device drivers available.

Reviewed by:	bryanv (earlier version), imp (earlier version)
Differential Revision:	https://reviews.freebsd.org/D28058
2021-01-21 01:21:35 +00:00
Vladimir Kondratyev
5cc21ab994 hmt: Allow I2C sampling mode support to be compiled out. 2021-01-20 23:10:07 +03:00
Vladimir Kondratyev
3e954a8bc6 hms: Workaround idle mouse drift in I2C sampling mode.
Many I2C "compatibility" mouse devices found on touchpads continue to
return last report data in sampling mode after touch has been ended.
That results in cursor drift.  Filter out such a reports with comparing
content of current report with content of previous one.

Reported by:	many
Tested by:	omatsuda, gllb (github.com)
Obtained from:	sysutils/iichid
2021-01-20 23:10:07 +03:00
Andriy Gapon
2c98edd6d6 htu21: driver for HTU21D I2C temperature and humidity sensor
MFC after:	2 weeks
Relnotes:	perhaps
2021-01-19 15:08:51 +02:00
Bryan Venteicher
9da9560c4d virtio: Add VirtIO PCI modern (V1) support
Use the existing legacy PCI driver as the basis for shared code
between the legacy and modern PCI drivers. The existing virtio_pci
kernel module will contain both the legacy and modern drivers.

Changes to the virtqueue and each device driver (network, block, etc)
for V1 support come in later commits.

Update the MMIO driver to reflect the VirtIO bus method changes, but
the modern compliance can be improved on later.

Note that the modern PCI driver requires bus_map_resource() to be
implemented, which is not the case on all archs.

The hw.virtio.pci.transitional tunable default value is zero so
transitional devices will continue to be driven via the legacy
driver.

Reviewed by: grehan (mentor)
Differential Revision: https://reviews.freebsd.org/D27856
2021-01-19 04:55:23 +00:00
Emmanuel Vadot
0a05676b44 Add driver for Synopsys Designware Watchdog timer.
This driver supports some arm and arm64 boards equipped with
"snps,dw-wdt"-compatible watchdog device.
Tested on RK3399-based board (RockPro64).
Once started watchdog device cannot be stopped.
Interrupt handler has mode to kick watchdog even when software does not do it
properly.
This can be controlled via sysctl: dev.dwwdt.prevent_restart.
Also - driver handles system shutdown and prevents from restart when system
is asked to reboot.

Submitted by:	kjopek@gmail.com
Differential Revision:	https://reviews.freebsd.org/D26761
2021-01-13 18:43:47 +01:00
Emmanuel Vadot
11d62b6f31 linuxkpi: add kernel_fpu_begin/kernel_fpu_end
With newer AMD GPUs (>=Navi,Renoir) there is FPU context usage in the
amdgpu driver.
The `kernel_fpu_begin/end` implementations in drm did not even allow nested
begin-end blocks.

Submitted by: Greg V
Reviewed By: manu, hselasky
Differential Revision: https://reviews.freebsd.org/D28061
2021-01-12 12:31:00 +01:00
Emmanuel Vadot
2c95fb753f linuxkpi: Add shrinker support
A driver can register a shrinker that will be called when the kernel
wants to free some memory.
Add support for that in linuxkpi and call the registered shrinkers
when the lowmem event is triggered.

Reviewed by:	bz
Differential Revision:	 https://reviews.freebsd.org/D27728
2021-01-12 12:31:00 +01:00