summaryrefslogtreecommitdiffstats
path: root/sys/modules
Commit message (Collapse)AuthorAgeFilesLines
* Do not build radeon kms modulesRenato Botelho2018-07-121-0/+4
|
* MFC r333099: Included opt_stack.h in Makefile, to fix module build outside ↵ram2018-05-291-0/+1
| | | | | | | | kernel build environment. PR: 227823 Reported by: eugen Approved by: re
* Merge remote-tracking branch 'origin/stable/11' into devel-11Renato Botelho2018-05-165-3/+17
|\
| * MFC r331340, r331342, r331472, r332050, r333276, r333448:np2018-05-153-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r331340: cxgbe(4): Tunnel congestion drops on a port should be cleared when the stats for that port are cleared. r331342: cxgbe(4): Do not read MFG diags information from custom boards. r331472: cxgbe(4): Always initialize requested_speed to a valid value. This fixes an avoidable EINVAL when the user tries to disable AN after the port is initialized but l1cfg doesn't have a valid speed to use. r332050: cxgbe(4): Always display an error message if SIOCSIFFLAGS will leave IFF_UP and IFF_DRV_RUNNING out of sync. ifhwioctl in the kernel pays no attention to the return code from the driver ioctl during SIOCSIFFLAGS so these messages are the only indication that the ioctl was called but failed. r333276: cxgbe(4): Update all firmwares to 1.19.1.0. r333448: cxgbe(4): Disable write-combined doorbells by default. This had been the default behavior but was changed accidentally as part of the recent iw_cxgbe+OFED overhaul. Fix another bug in that change while here: the global knob affects all the adapters in the system and should be left alone by per-adapter code. Approved by: re@ (marius@) Sponsored by: Chelsio Communications
| * MFC r333019 r333046 r333085 r333086 r333132sbruno2018-05-092-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | smartpqi(4): - Microsemi SCSI driver for PQI controllers. - Found on newer model HP servers. - Restrict to AMD64 only as per developer request. The driver provides support for the new generation of PQI controllers from Microsemi. This driver is the first SCSI driver to implement the PQI queuing model and it will replace the aacraid driver for Adaptec Series 9 controllers. HARDWARE Controllers supported by the driver include: HPE Gen10 Smart Array Controller Family OEM Controllers based on the Microsemi Chipset. Approved by: re (gjb@) Relnotes: yes
* | Merge remote-tracking branch 'origin/stable/11' into devel-11Renato Botelho2018-05-081-1/+1
|\ \ | |/
| * MFC r333149: ixl(4): Update to 1.9.9-kerj2018-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Major changes: - Support for descriptor writeback mode (required by ixlv(4) for AVF support) - Ability to disable firmware LLDP agent by user - Fix for TX queue hang when using TSO - Separate descriptor ring sizes for TX and RX rings Approved by: re (marius) Relnotes: yes Sponsored by: Intel Corporation
* | Merge remote-tracking branch 'origin/stable/11' into devel-11Luiz Souza2018-04-3051-62/+395
|\ \ | |/
| * MFC r331868, r332046, r332194-r332196, r332198, r332219, r332231, r332233, ↵ian2018-04-241-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r332240, r332258-r332259, r332261, r332292 r331868: Add opt_platform.h for several modules that have #ifdef FDT in the source. Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com> r332046: Add a missing MODULE_DEPEND(). r332194: Add support for writing/changing spi device ivars. The SPI mode (polarity and phase) and the maximum bus speed can be changed. The chip select number cannot be changed, because the device instances which are children of spibus are inherently associated with the chip select number they were instantiated for. r332195: A couple minor improvements to spibus.c... - Change the description string to "SPI bus" (was "spibus bus"). - This is the default driver for a SPI bus, not a generic implementation, so return the probe value that indicates such. - Use device_delete_children() at detach time, instead of a local loop to enumerate the children and detach each one individually. r332196: Return BUS_PROBE_DEFAULT, not zero, because this is not the one driver implementation that must be used, it's just the base system default driver. Also add a comment noting that we're being more liberal about the bus frequency property than the dts binding documents require. r332198: Arrange the list of generated sources as 1-per-line alphbetical, and add the files required when building for FDT-based systems. r332219: Remove the existing identify() hack to force-add a spigen device on FDT-based systems, and instead add proper FDT probe code. Because this driver is freebsd-specific and just provides generic userland access to run spibus transactions, there is no bindings document to mandate a compatible string, so just arbitrarily use "freebsd,spigen". r332231: Generate a spibus_set_[ivarname]() convenience function for each ivar, now that they can be set. r332233: Add an ioctl to get/set the SPI transfer mode. Also, make the bus clock frequency ioctl actually set the corresponding ivar instead of just storing the value locally in the softc (and then not using it for anything). Also, return the correct error code if the ioctl cmd is not recognized. r332240: Add the ioctl definitions for spigen get/set spi mode. Should have been part of r332233. r332258: Don't check for impossible NULL return from malloc(..., M_WAITOK). r332259: Cast the data pointer to the correct type for the data being accessed (as opposed to one that accidentally worked on the one arch I test-compiled for on my first try). Reported by: np@, O. Hartmann <ohartmann@walstatt.org> Pointy hat: ian@ r332261: Add a manpage for spigen(4). r332292: Allow hinted attachment on FDT-based systems. Instead of returning ENXIO when the FDT data doesn't enable the device instance, return BUS_PROBE_NOWILDCARD, the same as for non-FDT systems.
| * MFC r323206: Enable dtrace support for mips64 and the ERL kernel configlidl2018-04-163-4/+9
| | | | | | | | | | | | Turn on the required options in the ERL config file, and ensure that the fbt module is listed as a dependency for mips in the modules/dtrace/dtraceall/dtraceall.c file.
| * Fix mis-merge of r329507 in r331501gonzo2018-04-141-5/+0
| | | | | | | | | | | | | | sus/modules/Makefile part of r329507 just removed ffec while r331501 also added conditional clause for bcm283x_clkman and bcm283x_pwm. Since they're part of another revision, remove mi-merged chunk
| * MFC r328988,r328989:ae2018-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework ipfw dynamic states implementation to be lockless on fast path. o added struct ipfw_dyn_info that keeps all needed for ipfw_chk and for dynamic states implementation information; o added DYN_LOOKUP_NEEDED() macro that can be used to determine the need of new lookup of dynamic states; o ipfw_dyn_rule now becomes obsolete. Currently it used to pass information from kernel to userland only. o IPv4 and IPv6 states now described by different structures dyn_ipv4_state and dyn_ipv6_state; o IPv6 scope zones support is added; o ipfw(4) now depends from Concurrency Kit; o states are linked with "entry" field using CK_SLIST. This allows lockless lookup and protected by mutex modifications. o the "expired" SLIST field is used for states expiring. o struct dyn_data is used to keep generic information for both IPv4 and IPv6; o struct dyn_parent is used to keep O_LIMIT_PARENT information; o IPv4 and IPv6 states are stored in different hash tables; o O_LIMIT_PARENT states now are kept separately from O_LIMIT and O_KEEP_STATE states; o per-cpu dyn_hp pointers are used to implement hazard pointers and they prevent freeing states that are locklessly used by lookup threads; o mutexes to protect modification of lists in hash tables now kept in separate arrays. 65535 limit to maximum number of hash buckets now removed. o Separate lookup and install functions added for IPv4 and IPv6 states and for parent states. o By default now is used Jenkinks hash function. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D12685
| * MFC r331868:ian2018-04-065-1/+5
| | | | | | | | | | | | | | | | Add opt_platform.h for several modules that have #ifdef FDT in the source. Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com> PR: 227322 227323
| * MFC r331766, r331768:ken2018-04-042-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r331766 | ken | 2018-03-30 09:28:25 -0600 (Fri, 30 Mar 2018) | 25 lines Bring in the Broadcom/Emulex Fibre Channel driver, ocs_fc(4). The ocs_fc(4) driver supports the following hardware: Emulex 16/8G FC GEN 5 HBAS LPe15004 FC Host Bus Adapters LPe160XX FC Host Bus Adapters Emulex 32/16G FC GEN 6 HBAS LPe3100X FC Host Bus Adapters LPe3200X FC Host Bus Adapters The driver supports target and initiator mode, and also supports FC-Tape. Note that the driver only currently works on little endian platforms. It is only included in the module build for amd64 and i386, and in GENERIC on amd64 only. Submitted by: Ram Kishore Vegesna <ram.vegesna@broadcom.com> Reviewed by: mav Relnotes: yes Sponsored by: Broadcom Differential Revision: https://reviews.freebsd.org/D11423 ------------------------------------------------------------------------ r331768 | cem | 2018-03-30 10:44:54 -0600 (Fri, 30 Mar 2018) | 9 lines ocs_fc(4): Fix GCC build (-Wredundant-decls) These objects are defined earlier in the same file; an extern declaration after definition is redundant. Broken in r331766 (introduction of ocs_fc(4)). Sponsored by: Dell EMC Isilon ------------------------------------------------------------------------ Differential Revision: https://reviews.freebsd.org/D11423 Relnotes: yes
| * MFC r329832, r329926gonzo2018-03-302-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r329832: [chvgpio] add GPIO driver for Intel Z8xxx SoC family Add chvgpio(4) driver for Intel Z8xxx SoC family. This product was formerly known as Cherry Trail but Linux and OpenBSD drivers refer to it as Cherry View. This driver is derived from OpenBSD one so the name is kept for alignment with another BSD system. Submitted by: Tom Jones <tj@enoti.me> Reviewed by: gonzo, wblock(man page) Differential Revision: https://reviews.freebsd.org/D13086 r329926: Add SPDX tags for chvgpio driver sources Also move $FreeBSD$ keyword in header to BSD license
| * MFC r331452:hselasky2018-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add mutual exclusion mechanism for software reset of firmware in mlx5core. Since the FW can be shared between PCI functions it is common that more than one health poll will detected a failure, this can lead to multiple resets. The solution is to use a FW locking mechanism using semaphore space to provide a way to synchronize between functions. The FW semaphore is acquired via config cycle access. First the VSEC gateway must be acquired, then the semaphore can be locked by writing a value to it and confirmed it's locked by reading the same value back. The process in the same to free the semaphore, except the value written should be zero. Submitted by: slavash@ Sponsored by: Mellanox Technologies
| * MFC r330648:hselasky2018-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | Add support for explicit congestion notification, ECN, to mlx5ib(4). ECN configuration and statistics is available through a set of sysctl(8) nodes under sys.class.infiniband.mlx5_X.cong . The ECN configuration nodes can also be used as loader tunables. Sponsored by: Mellanox Technologies
| * MFC r303505, r303506, r303512, r303513, r303646, r320418, r323082,hselasky2018-03-3012-30/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r326169, r326563, r326649, r326716, r326764, r326765 and r329222: RoCE/infiniband/iWarp upgrade to Linux 4.9 for kernel and userspace. This commit merges projects/bsd_rdma_4_9 to 11-stable. Compatibility wrappers have been made for existing 11-stable ibcore APIs, including ib_reg_phys_mr(). Refer to "sys/ofed/include/rdma/ib_verbs_compat.h" for more information. The iw_cxgb driver has not been updated and has been disconnected from the build. Sponsored by: Mellanox Technologies MFC r326169 and r326563: RoCE/infiniband upgrade to Linux v4.9 for kernel and userspace. List of kernel sources used: ============================ 1) kernel sources were cloned from git://github.com/torvalds/linux.git Top commit 69973b830859bc6529a7a0468ba0d80ee5117826 - tag: v4.9, linux-4.9 2) krping was cloned from https://github.com/larrystevenwise/krping Top commit 292a2f1abf0348285e678a82264740d52e4dcfe4 List of userspace sources used: =============================== 1) rdma-core was cloned from https://github.com/linux-rdma/rdma-core.git Top commit d65138ef93af30b3ea249f3a84aa6a24ba7f8a75 2) OpenSM was cloned from git://git.openfabrics.org/~halr/opensm.git Top commit 85f841cf209f791c89a075048a907020e924528d 3) libibmad was cloned from git://git.openfabrics.org/~iraweiny/libibmad.git Tag 1.3.13 with some additional patches from Mellanox. 4) infiniband-diags was cloned from git://git.openfabrics.org/~iraweiny/infiniband-diags.git Tag 1.6.7 with some additional patches from Mellanox. NOTES: ====== 1) The mthca driver has been removed from userspace. 2) All GPLv2 only sources have been removed and where applicable rewritten from scratch under a BSD license. 3) List of fully supported drivers in userspace and kernel: a) iw_cxgbe (Chelsio) b) mlx4ib (Mellanox) c) mlx5ib (Mellanox) 4) WITH_OFED=YES is still required by make in order to build OFED userspace and kernel code. 5) Full support has been added for routable RoCE, RoCE v2. MFC r326649: Disconnect OFED after r326169 broke all DIRDEPS support for it. MFC r326716: Correctly define the unordered_map namespace in ofed/libibnetdisc . This should fix ofed/libibnetdisc compilation with C-compilers different from clang and GCC v4.2.1. Submitted by: kib Sponsored by: Mellanox Technologies MFC r326764: ofed: Remove duplicated symbols from the version file. ld.bfd accepts multiple listing of the same symbol in the version script. lld is stricter and errors out. Since arm64 and sometimes amd64 use lld, we should correct this cosmetic issue. Sponsored by: Mellanox Technologies Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D13329 MFC r326765: ofed: Define barriers for mips and arm. I used the strongest barriers available on the architectures, so if the future analysis show that it is excessive, the barriers could be relaxed. Still, it is unlikely that it is meaningful to run IB on 32bit ARM or current MIPS machines, so the change is to make WITH_OFED to pass tinderbox. Sponsored by: Mellanox Technologies Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D13329 MFC r303505: sdp: Use an mbufq for received control packets. This is simpler than the hand-rolled queue, and fixes a use-after-free. Sponsored by: EMC / Isilon Storage Division MFC r303506: sdp: Destroy the PCB lock before freeing to the zone. Sponsored by: EMC / Isilon Storage Division MFC r303512: sdp: Use malloc(9) instead of the Linux compat layer. SDP transmit and receive rings are always created in a sleepable context, so we can use M_WAITOK and remove error checks. Sponsored by: EMC / Isilon Storage Division MFC r303513: sdp: Destroy the RDMA ID after destroying the connection's queue pair. This is the ordering documented by rdma_destroy_qp(). Also add a useful KASSERT to sdp_pcbfree(). Sponsored by: EMC / Isilon Storage Division MFC r303646: ipoib: Bound the number of egress mbufs buffered during pathrec lookups. In pathological situations where the master subnet manager becomes unresponsive for an extended period, we may otherwise end up queuing all of the system's mbufs while waiting for a response to a path record lookup. This addresses the same issue as commit 1e85b806f9 in Linux. Reviewed by: cem, ngie Sponsored by: EMC / Isilon Storage Division MFC r329222: Import the mthca kernel side infiniband driver from Linux 4.9 and fix compilation under FreeBSD. The mthca driver was temporarily removed as part of the Linux 4.9 RoCE/infinband upgrade. Top commit in Linux source tree: 69973b830859bc6529a7a0468ba0d80ee5117826 Sponsored by: Mellanox Technologies MFC r320418. Note that the socket lock _is_ the same as so_rcv's lock in 11 and this is a no-op in this branch. Sponsored by: Chelsio Communications MFC r323082: cxgbe/iw_cxgbe: Set TCP_NODELAY before initiating connection so that t4_tom picks it up right away. This is less work than waiting for the connection to be established before applying the setting. Sponsored by: Chelsio Communications
| * MFC r330949:brooks2018-03-272-2/+2
| | | | | | | | | | | | | | | | | | | | | | Fix FSACTL_GET_NEXT_ADAPTER_FIB under 32-bit compat. This includes FSACTL_LNX_GET_NEXT_ADAPTER_FIB. Reviewed by: cem Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14672
| * MFC r330876, r330945brooks2018-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r330876: Fix ISP_FC_LIP and ISP_RESCAN on big-endian 64-bit systems. For _IO() ioctls, addr is a pointer to uap->data which is a caddr_t. When the caddr_t stores an int, dereferencing addr as an (int *) results in truncation on little-endian 64-bit systems and corruption (owing to extracting top bits) on big-endian 64-bit systems. In practice the value of chan was probably always zero on systems of the latter type as all such FreeBSD platforms use a register-based calling convention. Reviewed by: mav Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14673 r330945: Add opt_compat.h to isp(4) as required by r330876.
| * MFC r330819, r330885, r330934brooks2018-03-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r330819: Reject CAMIOGET and CAMIOQUEUE ioctl's on pass(4) in 32-bit compat mode. These take a union ccb argument which is full of kernel pointers. Substantial translation efforts would be required to make this work. By rejecting the request we avoid processing or returning entierly wrong data. Reviewed by: imp, ken, markj, cem Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14654 r330885: We need opt_compat.h after r330819 and 330820. Add opt_compat.h to fix the stand-alone build case. Sponsored by: Netflix. r330934: This should have been += so clean builds work. Noticed by: hps@
| * MFC r330653:hselasky2018-03-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add kernel and userspace code to dump the firmware state of supported ConnectX-4/5 devices in mlx5core. The dump is obtained by reading a predefined register map from the non-destructive crspace, accessible by the vendor-specific PCIe capability (VSC). The dump is stored in preallocated kernel memory and managed by the mlx5tool(8), which communicates with the driver using a character device node. The utility allows to store the dump in format <address> <value> into a file, to reset the dump content, and to manually initiate the dump. A call to mlx5_fwdump() should be added at the places where a dump must be fetched automatically. The most likely place is right before a firmware reset request. Submitted by: kib@ Sponsored by: Mellanox Technologies
| * MFC r330651:hselasky2018-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | Add vendor specific capability interface support in mlx5core. Add the ability to access the vendor specific space gateway in order to support reading and writing data into the different configuration domains. Submitted by: Matthew Finlay <matt@mellanox.com> Sponsored by: Mellanox Technologies
| * MFC r330437-r330438, r330440, r331045ian2018-03-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r330437: Do not stop the loop that configures gpio chipselect pins on the first error, just ignore pins that don't configure and keep setting up the ones that do. (But when bootverbose is on, whine about the errors.) r330438: Defer attaching the spibus until timers and interrupts are working. The driver requires interrupts to do transfers, and the drivers for the SPI devices on the bus quite reasonably expect to be able to do IO while probing and attaching. r330440: Switch imx_gpio to attach at BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE. Pretty much any other device might need to manipulate a gpio pin during its probe or attach routines, so these devices must be available as early as possible. The gpio device is an interrupt controller, but I didn't choose the INTERRUPT pass for that reason (it works fine as an interrupt controller as long as it attaches any time before interrupts are enabled). That just looked like the right place in the passes to ensure that it attaches before any type of device that might need gpio pin manipulations. r331045: Add required interface header. Reported by: andreast@
| * MFC r310017, r310229, r312289, r327260, r329539, r329544-r329546, r329620,ian2018-03-247-1/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r329729, r329911, r329999 r310017: [spi] reformat message This commit corrects print of nomatch (newline was too early) Submitted by: Hiroki Mori <yamori813@yahoo.co.jp> Reviewed by: ray, loos, mizhka Differential Revision: https://reviews.freebsd.org/D8749 r310229: ofw_spi: Parse property for the SPI mode and CS polarity. As cs is stored in a uint32_t, use the last bit to store the active high flag as it's unlikely that we will have that much CS. Reviewed by: loos Differential Revision: https://reviews.freebsd.org/D8614 r312289: [spibus] small code refactoring Merge 3 sequential printf calls into one. Reported by: rpokala Reviewed by: rpokala, adrian Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D8795 r327260: SPDX: fix wrong license ID tag in dev/spibus. r329539: Provide public declarations for ofw_spibus_driver and ofw_spibus_devclass so other drivers can refer to them in DRIVER_MODULE() decls. r329544: Add modules/spi as a gathering point for SPI-related modules, analagous to modules/i2c for i2c/iicbus modules. Build spibus as a module. r329545: Add ofw_bus_if.h to SRCS. r329546: Build at45d and mx25l SPI flash drivers as modules. r329620: Add missing MODULE_DEPENDS(). r329729: Remove some files that snuck in via cut and paste. Having these compiled into the module causes the kobj method descriptors to be resolved incorrectly (by the compile-time linker instead of the kernel linker), which then leads to hours of frustrating debugging. r329911: Add a functional detach() routine, to make things kldunload-friendly. r329999: Add a SPI driver for imx5 and imx6. It can be compiled into the kernel with "device imx_spi" or loaded as a module, which is also named "imx_spi".
| * MFC r325233, r328956, r329170, r329172-r329173, r329224, r330403-r330407,ian2018-03-243-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r330411-r330412, r330416, r330430-r330431, r330433, r330528-r330529, r330767 r325233: [i2c/clock] add support for EPSON RTC-8583 RTC-8583 is time-of-day clock used in some SOHO routers. This clock has only 2 bits for year values, but thanks to user SRAM it's possible to save year value and keep it up to date via driver code. Tested on Planex_MZK-W300NAG (SoC is RT2880) Submitted by: Hiroki Mori <yamori83@yahoo.co.jp> Differential Revision: https://reviews.freebsd.org/D12833 r328956: Use const pointers for input data not modified by clock utility functions. r329170: Replace the existing print_ct() private debugging function with a set of three public functions to format and print the three major data structures used by realtime clock drivers (clocktime, bcd_clocktime, and timespec). r329172: Add a set of convenience routines for RTC drivers to use for debug output, and a debug.clock_show_io sysctl to control debugging output. r329173: Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot read or write of all registered realtime clocks. In the read case, the values read are simply discarded. For writes, there's no alternative but to actually write the current system time to the device. r329224: Fix bad indentation. Whitespace only, no functional changes. Reported by: bde@ r330403: Add calls to the new clock_dbgprint_xxx() functions. r330404: Add calls to the new clock_dbgprint_xxx() functions. r330405: Oops, fix a paste-o. r330406: Add calls to the new clock_dbgprint_xxx() functions. r330407: Add calls to the new clock_dbgprint_xxx() functions. Also, stop applying a local .5 second adjustment to the time, since that is now done by the code in subr_rtc.c. r330411: Convert to the new(ish) bcd_clocktime conversion functions, add calls to the new debug output functions, and when setting the clock, propagate the timespec nsecs to the 1/100ths register. r330412: Build iicbus/rtc8583 as a module. r330416: The year is stored in a single byte in sram, in binary format, as a count of years since the century, so strip the century out when converting to or from bcd_clocktime format (the conversion routines will infer century by pivoting on 70). r330430: Switch to the new bcd_clocktime conversion routines, and add calls to the new clock_dbgprint_xxx() functions. r330431: Switch to the new bcd_clocktime conversion routines, and add calls to the new clock_dbgprint_xxx() functions. r330433: Switch to the new bcd_clocktime conversion routines, and add calls to the new clock_dbgprint_xxx() functions. r330528: Fix a paste-o that broke the build. There is no softc pointer here, just use the dev arg. Reported by: Jonathan Looney <jonlooney@gmail.com> Pointy hat: ian@ r330529: Build the ds1672 driver as a module. Add a detach() to unregister the rtc. r330767: Convert atrtc the new style rtc debugging output. Remove the db show command handler which provided much the same information. Removing the possibility of accessing the hardware regs from the debugger context paves the way for simplifying the locking code in the driver.
| * MFC r329534-r329535ian2018-03-241-4/+13
| | | | | | | | | | | | | | | | | | | | r329534: Arrange SRCS= as 1 file per line, alphabetical, so it's easier to maintain. Whitespace only, no functional changes. r329535: Add iic_recover_bus.c, now part of iicbus. This should have been added as part of r320463.
| * MFC r329479-r329480, r329483, r329506-r329507, r329526, r329529, r329536,ian2018-03-244-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r329541, r329730, r329841, r329988, r330397 r329479: Do not try to deallocate memory that wasn't allocated (you'd think that would be safe, but the function also tries to destroy mutexes that never got created). I guess this can only happen when imx_ehci_detach() is called on the error-exit path from imx_ehci_attach(), and that path never got exercised before today. r329480: Don't call sdhci_cleanup_slot() if sdhci_init_slot() never got called. Also, do callout_init() very early in attach, so that callout_drain() can be called in detach without worrying about whether it ever got init'd. r329483: Fix fallout from the import of fresh dts source files from linux 4.15. It appears that node names no longer include leading zeroes in the @address qualifiers, so we have to search for the nodes involved in interrupt fixup using both flavors of name to be compatible with old and new .dtb files. (You know you're in a bad place when you're applying a workaround to code that exists only as a workaround for another problem.) r329506: Add a detach method so that this can be a kldunload-friendly module. r329507: Build modules specific to imx5/imx6 only when building those kernels. This adds sys/modules/imx with a SUBDIR makefile to make the whole collection of modules that are specific to these SoCs. Initially, that "whole collection" consists of the if_ffec and imx_i2c drivers. The if_ffec driver is referenced in its existing home in ../ffec rather than moving it into the imx directory, because it's used by powerpc too, but it is no longer built for all armv6/7 systems. The imx_i2c driver is newly added as a module. r329526: Allow i2c hardware drivers to declare their own relationships to ofw_iicbus rather than relying on a set of canned EARLY_DRIVER_MODULE() statements in the ofw_iicbus source. This means hw drivers will no longer be required to use one of a few predefined driver names. They will also now be able to decide themselves if they want to use DRIVER_MODULE or EARLY_DRIVER_MODULE and to set which pass to attach on for early modules. Mainly, this adds extern declarations for the driver and devclass variables. It also renames ofwiicbus_devclass to ofw_iicbus_devclass to be consistant with the way we use ofw_ prefixes on this stuff. r329529: Give the imx_i2c driver its own name, set up its relationship to ofw_iicbus. Previously it called itself 'iichb' to link up with the EARLY_DRIVER_MODULE declaration in ofw_iicbus.c. r329536: Add the MODULE_DEPEND()s needed so that the kernel linker can resolve all the symbols at load time when iicbus is not compiled into the kernel. r329541: Build ofw_iicbus as a module if OPT_FDT is defined. r329730: Add required header files. Reported by: andreast@ r329841: Add a missing line continuation. How many commits does it take to get a simple module makefile working? Apparently at least three. Pointy hat to: ian r329988: Instead of building ofw_iicbus as a separate module, just compile it in to the iicbus module for FDT-based systems. The primary motivation for this is that host controller drivers which declare DRIVER_MODULE(ofw_iicbus, thisdriver, etc, etc) now only need a single MODULE_DEPEND(thisdriver, ofw_iicbus) for runtime linking to resolve all the symbols. With ofw_iicbus and iicbus in separate modules, drivers would need to declare a MODULE_DEPEND() on both, because symbol lookup is non-recursive through the dependency chain. Requiring a driver to have MODULE_DEPENDS() on both amounts to requiring the drivers to understand the kobj inheritence details of how ofw_iicbus is implemented, which seems like something they shouldn't have to know (and could even change some day). Also, this is somewhat analogous to how the drivers get built when compiled into the kernel. You don't have to ask for ofw_iicbus separately, it just gets built in along with iicbus when option FDT is in effect. r330397: Fix a paste-o: use the IICBUS version constants, not IICBB bitbang driver's.
| * MFC (partially) r326066, r326121: Add an EFI RTC Driverkevans2018-03-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This is effectively a direct commit to stable/11 to avoid the arm64 bits, as those are unfortunately not able to MFC'd. MFC r326066: Add a driver for the EFI RTC. This uses the EFI Runtime Services to query the system time. MFC r326121: Zero struct efi_tm before setting the needed values. We don't use the dst or timezone fields so ensure these are set.
| * Revert r331022: MFC of EFI Runtime Service support on aarch64kevans2018-03-151-1/+0
| | | | | | | | | | | | | | Apologies; this is NOT an MFC'able change. It requires a good number of pcb changes that would break KBI. Pointy hat to: me
| * MFC r324495: Support the EFI Runtime Services on arm64. As with amd64 we usekevans2018-03-151-0/+1
| | | | | | | | | | | | | | | | | | | | the 1:1 mapping. This uses the new common code shared with amd64. The RTC should only be accessed via EFI. There is no locking around it as the spec only has this as a requirement for the PC-AT CMOS device. NOTE: r326311's changes to arm64/efirt_machdep.c have been hand-applied to this import of efirt_machdep.c due to r326311 having already been merged.
| * MFC r322278,324177: EFIRT Improvementskevans2018-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r322278 (imp): Fail to open efirt device when no EFI on system. libefivar expects opening /dev/efi to indicate if the we can make efi runtime calls. With a null routine, it was always succeeding leading efi_variables_supported() to return the wrong value. Only succeed if we have an efi_runtime table. Also, while I'm hear, out of an abundance of caution, add a likely redundant check to make sure efi_systbl is not NULL before dereferencing it. I know it can't be NULL if efi_cfgtbl is non-NULL, but the compiler doesn't. r324177 (andrew): To prepare for adding EFI runtime services support on arm64 move the machine independent parts of the existing code to a new file that can be shared between amd64 and arm64. Care has been taken to ensure that the MFC of r324177 did not clobber cherry-picked MFC's.
| * MFC r330304: imcsmb(4): Intel integrated Memory Controller (iMC) SMBusrpokala2018-03-092-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | controller driver imcsmb(4) provides smbus(4) support for the SMBus controller functionality in the integrated Memory Controllers (iMCs) embedded in Intel Sandybridge- Xeon, Ivybridge-Xeon, Haswell-Xeon, and Broadwell-Xeon CPUs. Each CPU implements one or more iMCs, depending on the number of cores; each iMC implements two SMBus controllers (iMC-SMBs). *** IMPORTANT NOTE *** Because motherboard firmware or the BMC might try to use the iMC-SMBs for monitoring DIMM temperatures and/or managing an NVDIMM, the driver might need to temporarily disable those functions, or take a hardware interlock, before using the iMC-SMBs. Details on how to do this may vary from board to board, and the procedure may be proprietary. It is strongly suggested that anyone wishing to use this driver contact their motherboard vendor, and modify the driver as described in the manual page and in the driver itself. (For what it's worth, the driver as-is has been tested on various SuperMicro motherboards.)
| * MFC r319506, r319872, r321063, r321103, r321179, r321390, r321435,np2018-03-034-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r321582, r321671, r322014, r322034, r322055, r322123, r322167, r322425, r322549, r322914, r322960, r322962, r322964, r322985, r322990, r323006, r323026, r323041, r323069, r323078, r323343, r323514, r323520, r324296, r324379, r324386, r324443, r324945, r325596, r325680, r325880, r325883-r325884, r325961, r326026, r326042, r327062, r327093, r327332, r327528, r328420, and r328423. r319506: cxgbe(4): Update the statistics for compound tx work requests once per work request, not once per frame. r319872: cxgbe(4): Do not request an FEC setting that the port does not support. r321063: cxgbe(4): Various link/media related improvements. - Deal with changes to port_type, and not just port_mod when a transceiver is changed. This fixes hot swapping of transceivers of different types (QSFP+ or QSA or QSFP28 in a QSFP28 port, SFP+ or SFP28 in a SFP28 port, etc.). - Always refresh media information for ifconfig if the port is down. The firmware does not generate tranceiver-change interrupts unless at least one VI is enabled on the physical port. Before this change ifconfig diplayed potentially stale information for ports that were administratively down. - Always recalculate and reapply L1 config on a transceiver change. - Display PAUSE settings in ifconfig. The driver sysctls for this continue to work as well. r321103: cxgbe(4): New ioctls to flash bootrom and boot config to the card. r321179: cxgbe/t4_tom: Log more details about the newly ESTABLISHED tid to the trace buffer. r321390: cxgbe(4): Install the firmware bundled with the driver to the card if it doesn't seem to have one. This lets the driver recover automatically from incomplete firmware upgrades (panic, reboot, power loss, etc. in the middle of an upgrade). r321435: cxgbe(4): Display some more TOE parameters related to retransmission and keepalive in the sysctl MIB. Provide tunables to change some of these parameters. These are supposed to be setup by the firmware so these tunables are for experimentation only. r321582: cxgbe(4): Some updates to the common code. - Updated register ranges. - Helper routines for access to TP registers. - Updated routine to read flash parameters. r321671: cxgbe/iw_cxgbe: Log the end point's history and flags to the trace buffer just before it's freed. r322014: cxgbe(4): Initial import of the "collect" component of Chelsio unified debug (cudbg) code, hooked up to the main driver via an ioctl. The ioctl can be used to collect the chip's internal state in a compressed dump file. These dumps can be decoded with the "view" component of cudbg. r322034: cxgbe(4): Always use the first and not the last virtual interface associated with a port in begin_synchronized_op. r322055: cxgbe(4): Allow the TOE timer tunables to be set with microsecond precision. These timers are already displayed in microseconds in the sysctl MIB. Add variables to track these tunables while here. r322123: cxgbe(4): Avoid a NULL dereference that would occur during module unload if there were problems earlier during attach. r322167: cxgbe(4): Add the T6 and T5 Unified Wire configuration files to the kernel, just like for T4, when the driver is compiled into the kernel. r322425: cxgbe(4): Save the last reported link parameters and compare them with the current state to determine whether to generate a link-state change notification. This fixes a bug introduced in r321063 that caused the driver to sometimes skip these notifications. r322549: cxgbe/t4_tom: Use correct name for the ISS-valid bit in options2. r322914: cxgbe(4): Dump the mailbox contents in the same format as CH_DUMP_MBOX. r322960: cxgbe(4): Verify that the driver accesses the firmware mailbox in a thread-safe manner. r322962: cxgbe(4): Remove write only variable from t4_port_init. r322964: cxgbe(4): vi_mac_funcs should include the base Ethernet function. It is already used in the driver as if it does. r322985: cxgbe(4): Maintain one ifmedia per physical port instead of one per Virtual Interface (VI). All autonomous VIs that share a port share the same media. r322990: cxgbe(4): Do not access the mailbox without appropriate locks while creating hardware VIs. This fixes a bad race on systems with hw.cxgbe.num_vis > 1. r323006: cxgbe(4): Update T6/T5/T4 firmwares to 1.16.59.0. r323026: cxgbe(4): Zero out the memory allocated for the debug dump. cudbg_collect seems to expect it this way. r323041: cxgbe(4): Add two new debug flags -- one to allow manual firmware install after full initialization, and another to disable the TCB cache (T6+). The latter works as a tunable only. Note that debug_flags are for debugging only and should not be set normally. r323069: cxgbe/t4_tom: Add a knob to select the congestion control algorigthm used by the TOE hardware for fully offloaded connections. The knob affects new connections only. r323078: cxgbe/t4_tom: There may not be a tid to update if the connection isn't established. r323343: cxgbe(4): Fix a couple of problems in the sge_wrq data path. - start_wrq_wr must not drain the wr_list if there are incomplete_wrs pending. This can happen when a t4_wrq_tx runs between two start_wrq_wr. - commit_wrq_wr must examine the cookie's pidx and ndesc with the queue's lock held. Otherwise there is a bad race when incomplete WRs are being completed and commit_wrq_wr for the WR that is ahead in the queue updates the next incomplete WR's cookie's pidx/ndesc but the commit_wrq_wr for the second one is using stale values that it read without the lock. r323514: cxgbetool(8): mode must be specified when creating the dump file. r323520: cxgbe(4): Ignore capabilities that depend on TOE when the firmware reports TOE is not available. r324296: cxgbe(4): Provide knobs to set the holdoff parameters of TOE rx queues separately from NIC rx queues instead of using the same parameters for both types of queues. r324379: cxgbetool(8): Do not create a large file devoid of useful content when the dumpstate ioctl fails. Make the file world-readable while here. r324386: cxgbe(4): Update T6, T5, and T4 firmwares to 1.16.63.0. r324443: cxgbetool(8): Do not close uninitialized fd on malloc failure. r324945: cxgbe(4): Read the MPS buffer group map from the firmware as it could be different from hardware defaults. The congestion channel map, which is still fixed, needs to be tracked separately now. Change the congestion setting for TOE rx queues to match the drivers on other OSes while here. r325596: cxgbe(4): Do not request settings not supported by the port. r325680: cxgbe(4): Excluce mdi from the check against port capabilities. r325880: cxgbe(4): Combine all _10g and _1g tunables and drop the suffix from their names. The finer-grained knobs weren't practically useful. r325883: cxgbe(4): Sanitize t4_num_vis during MOD_LOAD like all other t4_* tunables. Add num_vis to the intrs_and_queues structure as it affects the number of interrupts requested and queues created. In future cfg_itype_and_nqueues might lower it incrementally instead of going straight to 1 when enough interrupts aren't available. r325884: cxgbe(4): Remove rsrv_noflowq from intrs_and_queues structure as it does not influence or get affected by the number of interrupts or queues. r325961: cxgbe(4): Add core Vdd to the sysctl MIB. r326026: cxgbe(4): Add a custom board to the device id list. r326042: cxgbe(4): Fix unsafe mailbox access in cudbg. r327062: cxgbe(4): Read the MFG diags version from the VPD and make it available in the sysctl MIB. r327093: cxgbe(4): Do not forward interrupts to queues with freelists. This leaves the firmware event queue (fwq) as the only queue that can take interrupts for others. This simplifies cfg_itype_and_nqueues and queue allocation in the driver at the cost of a little (never?) used configuration. It also allows service_iq to be split into two specialized variants in the future. r327332: cxgbe(4): Reduce duplication by consolidating minor variations of the same code into a single routine. r327528: cxgbe(4): Add a knob to enable/disable PCIe relaxed ordering. Disable it by default when running on Intel CPUs. r328420: cxgbe(4): Do not display harmless warning in non-debug builds. r328423: cxgbe(4): Accept old names of a couple of tunables. Sponsored by: Chelsio Communications
| * MFC ↵eadler2018-03-016-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r313419,r313420,r313421,r313423,r313426,r313428,r314078,r314079,r319584,r319586,r319588,r324469,r324470,r324435,r325122: [iwmfw] add version 17 firmware. [iwmfw] add version 17 firmware. [iwmfw] add version 17 firmware. [iwmfw] add this 3 megabyte firmware image. [iwmfw] bump firmware to version 17. [iwmfw] back this out to version 16 for now. [iwmfw] add 7265D firmware. [iwmfw] add 7265D firmware. [iwmfw] add 7265D-22 firmware [iwmfw] 8000C ver 22 firmware. [iwmfw] bump built firmware now to version 22 for 7265D and 8000C. [iwmfw] Add missing SUBDIR needed for iwmfw to load after ^/head@r324434 [iwmfw] Add the firmware for the Intel 8265 WiFi device.
| * MFC r324434:eadler2018-03-011-0/+6
| | | | | | | | | | | | Add support for Intel 8265 WiFi Obtained from: OpenBSD
| * MFC r318222:eadler2018-03-011-2/+2
| | | | | | | | | | | | | | | | | | | | [iwm] Factor out firmware station handling into if_iwm_sta.c. * This adds iwm_mvm_rm_sta(), which will be used to tear down firmware state for better/cleaner iwm_newstate() handling. * Makes iwm_enable_txq() and iwm_mvm_flush_tx_path() non-static, add the declarations to if_iwm_util.h for now.
| * MFC r314192,r314209:eadler2018-03-011-1/+1
| | | | | | | | | | | | | | [iwm] Add support for Firmware paging, needed for newer 8000C firmware. * Uses the IWM_FW_PAGING_BLOCK_CMD firmware command to tell the firmware what memory ranges to use for paging.
| * MFC 314151:eadler2018-03-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Unbreak if_iwm.ko after r314076 Add if_iwm_7000.c/if_iwm_8000.c to SRCS to match similar additions made to sys/conf/files after refactoring done in the commit noted. PR: 217308 Pointyhat to: adrian Submitted by: Andreas Nilsson <andrnils@gmail.com> Reported by: Jakob Alvermark <jakob@alvermark.net>, Juan Ramómon Molina Menor <listjm@club.fr>
| * MFC r313322,r313354:eadler2018-03-011-1/+1
| | | | | | | | [iwm] Add implementation of the notification wait api from iwlwifi.
* | Merge remote-tracking branch 'origin/stable/11' into devel-11Renato Botelho2018-02-284-0/+18
|\ \ | |/
| * MFC r329843:rpokala2018-02-282-0/+8
| | | | | | | | | | | | | | | | | | | | jedec_dimm(4): report asset info and temperatures for DDR3 and DDR4 DIMMs A super-set of the functionality of jedec_ts(4). jedec_dimm(4) reports asset information (Part Number, Serial Number) encoded in the "Serial Presence Detect" (SPD) data on JEDEC DDR3 and DDR4 DIMMs. It also calculates and reports the memory capacity of the DIMM, in megabytes. If the DIMM includes a "Thermal Sensor On DIMM" (TSOD), the temperature is also reported.
| * MFC r323067, r323184, r323185, r323195, r323196 (by cem)truckman2018-02-222-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r323067 | cem | 2017-08-31 11:39:18 -0700 (Thu, 31 Aug 2017) | 4 lines amdtemp.4: Update BKDG URL to current location Sponsored by: Dell EMC Isilon ------------------------------------------------------------------------ r323184 | cem | 2017-09-05 08:13:41 -0700 (Tue, 05 Sep 2017) | 10 lines Add smn(4) driver for AMD System Management Network AMD Family 17h CPUs have an internal network used to communicate between the host CPU and the PSP and SMU coprocessors. It exposes a simple 32-bit register space. Reviewed by: avg (no +1), mjoras, truckman Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12217 ------------------------------------------------------------------------ r323185 | cem | 2017-09-05 08:19:14 -0700 (Tue, 05 Sep 2017) | 13 lines amdtemp(4): Add support for Family 17h temperature sensor The sensor value is formatted similarly to previous models (same bitfield sizes, same units), but must be read off of the internal System Management Network (SMN) from the System Management Unit (SMU) co-processor. PR: 218264 Reported and tested by: Nils Beyer <nbe AT renzel.net> Reviewed by: avg (no +1), mjoras, truckman Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12217 ------------------------------------------------------------------------ r323195 | cem | 2017-09-05 13:35:25 -0700 (Tue, 05 Sep 2017) | 8 lines amdtemp(4): Do not probe not matching hostbridges Some systems have hostbs that do not match our PCI device id criteria. Detect and ignore these devices in probe. PR: 218264 Sponsored by: Dell EMC Isilon ------------------------------------------------------------------------ r323196 | cem | 2017-09-05 14:00:33 -0700 (Tue, 05 Sep 2017) | 8 lines amdsmn(4): Do not probe not matching hostbridges Similar to r323195, but for amdsmn(4) driver (which borrowed some design). Ignore hostbs that do not match our PCI device id criteria. Sponsored by: Dell EMC Isilon PR: 218264 Differential Revision: https://reviews.freebsd.org/D12217
* | Merge remote-tracking branch 'origin/stable/11' into devel-11Luiz Souza2018-02-1911-38/+90
|\ \ | |/
| * MFC r320851:markj2018-02-181-0/+1
| | | | | | | | Add a helper function to agp(4) which installs a single GTT entry.
| * MFC r314933-r314934gonzo2018-02-142-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r314933: [spigen] make spigen device ready to be compiled as a module - Add flag to indicate that device is opened by userland - Replace "always fail" detach method with proper detach implementation r314934: [spigen] Add spigen module spigen provides userland API to SPI bus. Make it available as a loadable module so people using official ARM images can enabled it on devices like BBB or RPi without re-building kernel
| * MFC r325638 and r325976:hselasky2018-02-131-2/+2
| | | | | | | | | | | | | | | | | | | | Refactor the flowsteering APIs used by mlx5en(4). This change is needed by the coming ibcore and mlx5ib updates in order to support traffic redirection to so-called raw ethernet QPs. Remove unused E-switch related routines and files while at it. Sponsored by: Mellanox Technologies
| * MFC r306486-r325841:hselasky2018-02-125-32/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the mlx4, mlx4ib(4) and mlx4en(4) drivers to match FreeBSD-head prior to the Linux 4.9 RoCE/infiniband upgrade. Sponsored by: Mellanox Technologies MFC r306486: Move the ConnectX-3 and ConnectX-2 driver from sys/ofed into sys/dev/mlx4 like other PCI network drivers. The sys/ofed directory is now mainly reserved for generic infiniband code, with exception of the mthca driver. - Add new manual page, mlx4en(4), describing how to configure and load mlx4en. - All relevant driver C-files are now prefixed mlx4, mlx4_en and mlx4_ib respectivly to avoid object filename collisions when compiling the kernel. This also fixes an issue with proper dependency file generation for the C-files in question. - Device mlxen is now device mlx4en and depends on device mlx4, see mlx4en(4). Only the network device name remains unchanged. - The mlx4 and mlx4en modules are now built by default on i386 and amd64 targets. Only building the mlx4ib module depends on WITH_OFED=YES . Sponsored by: Mellanox Technologies MFC r310425: mlx: avoid use of __DATE__ to make build reproducible Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D8886 MFC r310488: mlx(4): remove date from log message Further to r310425, go one step further and just remove the date. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D8888 MFC r324200: Implement SIOCGIFRSS{KEY,HASH} for the mlx4en(4) driver. Differential Revision: https://reviews.freebsd.org/D12176 Sponsored by: Mellanox Technologies MFC r324201: Setup mbuf hash type properly when receiving IP packets in the mlx4en(4) driver. Submitted by: sephe@ Differential Revision: https://reviews.freebsd.org/D12229 Sponsored by: Mellanox Technologies MFC r324621: mlx4: use enum constants instead of const vars for case exprs Follow up from r324201 to fix compilation with gcc, which complains about non-ICE case expressions. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D12675 MFC r325841: Update the mlx4 core and mlx4en(4) modules towards Linux v4.9. Background: The coming ibcore update forces an update of mlx4ib(4) which in turn requires an updated mlx4 core module. This also affects the mlx4en(4) module because commonly used APIs are updated. This commit is a middle step updating the mlx4 modules towards the new ibcore. This change contains no major new features. Changes in mlx4: a) Improved error handling when mlx4 PCI devices are detached inside VMs. b) Major update of codebase towards Linux 4.9. Changes in mlx4ib(4): a) Minimal changes needed in order to compile using the updated mlx4 core APIs. Changes in mlx4en(4): a) Update flow steering code in mlx4en to use new APIs for registering MAC addresses and IP addresses. b) Update all statistics counters to be 64-bit. c) Minimal changes needed in order to compile using the updated mlx4 core APIs. Sponsored by: Mellanox Technologies
| * MFC r325795 (by imp):mav2018-02-101-0/+1
| | | | | | | | | | Belatedly add opt_nvme.h to fix building nvme.ko outside of a kernel build.
| * MFC r310014-r327788:hselasky2018-02-012-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an overwrite merge backport of the LinuxKPI from FreeBSD-head. Following is a complete list of MFC'ed revisions and also partially MFC'ed revisions in the end. The MFC'ed revision are listed in incremental order. Bump the __FreeBSD_version to force recompilation of any external kernel modules. Sponsored by: Mellanox Technologies MFC r310014: Remove the only user of sysctl_add_oid(). My plan is to change this function's prototype at some point in the future to add a new label argument, which can be used to export all of sysctl as metrics that can be scraped by Prometheus. Switch over this caller to use the macro wrapper counterpart. MFC r310031: linuxkpi: Fix not-found case of linux_pci_find_irq_dev Linux list_for_each_entry() does not neccessarily end with the iterator NULL (it may be an offset from NULL if the list member is not the first element of the member struct). Reported by: Coverity CID: 1366940 Reviewed by: hselasky@ Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8780 MFC r313806: Whitespace fix. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r313807: Allow passing a constant atomic_t to atomic_read(). Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r313808: Implement more LinuxKPI atomic functions and macros. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r313810: Allow container_of() to be used with constant data pointers. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r313872: Implement GFP_DMA32 flag in the LinuxKPI. Define all FreeBSD native GFP bits as GFP_NATIVE_MASK. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r314040: Make the LinuxKPI task struct persistent accross system calls. A set of helper functions have been added to manage the life of the LinuxKPI task struct. When an external system call or task is invoked, a check is made to create the task struct by demand. A thread destructor callback is registered to free the task struct when a thread exits to avoid memory leaks. This change lays the ground for emulating the Linux kernel more closely which is a dependency by the code using the LinuxKPI APIs. Add new dedicated td_lkpi_task field has been added to struct thread instead of abusing td_retval[1]. Fix some header file inclusions to make LINT kernel build properly after this change. Bump the __FreeBSD_version to force a rebuild of all kernel modules. Sponsored by: Mellanox Technologies MFC r314043: Add support for LinuxKPI tasklets. Tasklets are implemented using a taskqueue and a small statemachine on top. The additional statemachine is required to ensure all LinuxKPI tasklets get serialized. FreeBSD taskqueues do not guarantee serialisation of its tasks, except when there is only one worker thread configured. Sponsored by: Mellanox Technologies MFC r314044: Streamline the LinuxKPI spinlock wrappers. 1) Add better spinlock debug names when WITNESS_ALL is defined. 2) Make sure that the calling thread gets bound to the current CPU while a spinlock is locked. Some Linux kernel code depends on that the CPU ID doesn't change while a spinlock is locked. 3) Add support for using LinuxKPI spinlocks during a panic(). Sponsored by: Mellanox Technologies MFC r314050: Replace dummy implementation of RCU in the LinuxKPI with one based on the in-kernel concurrency kit's ck_epoch API. Factor RCU hlist_xxx() functions into own rculist.h header file. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r314105: Improve LinuxKPI scatter list support. The i915kms driver in Linux 4.9 reimplement parts of the scatter list functions with regards to performance. In other words there is not so much room for changing structure layouts and functionality if the i915kms should be built AS-IS. This patch aligns the scatter list support to what is expected by the i915kms driver. Remove some comments not needed while at it. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r314106: Optimise unmapped LinuxKPI page allocations. When allocating unmapped pages, take advantage of the direct map on AMD64 to get the virtual address corresponding to a page. Else all pages allocated must be mapped because sometimes the virtual address of a page is requested. Move all page allocation and deallocation code into an own C-file. Add support for GFP_DMA32, GFP_KERNEL, GFP_ATOMIC and __GFP_ZERO allocation flags. Make a clear separation between mapped and unmapped allocations. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r314109: Convert magic values into macros in the LinuxKPI scatterlist implementation. Suggested by: cem @ Sponsored by: Mellanox Technologies MFC r314136: Implement __test_and_clear_bit() and __test_and_set_bit() in the LinuxKPI. The clang compiler will optimise these functions down to three AMD64 instructions if the bit argument is a constant during compilation. Sponsored by: Mellanox Technologies MFC r314205: Implement BIT_ULL() macro in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r314207: Implement srcu_dereference() macro in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r314214: Prototype device structure to ensure LinuxKPI header file can be included standalone. Sponsored by: Mellanox Technologies MFC r314215: Implement more string functions in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r314336: Define __sum16 type in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r314337: Implement more bit operation functions in the LinuxKPI. Some minor whitespace nits while at it. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r314604: Update the LinuxKPI RCU and SRCU wrappers for the concurrency kit, CK. - Optimise the RCU implementation to not allocate and free ck_epoch_records during runtime. Instead allocate two sets of ck_epoch_records per CPU for general purpose use. The first set is only used for reader locks and the second set is only used for synchronization and barriers and is protected with a regular mutex to prevent simultaneous issues. - Move the task structure away from the rcu_head structure and into the per-CPU structures. This allows the size of the rcu_head structure to be reduced down to the size of two pointers. - Fix a bug where the linux_rcu_barrier() function only waited for one per-CPU epoch record to be completed instead of all. - Use a critical section or a mutex to protect ck_epoch_begin() and ck_epoch_end() depending on RCU or SRCU type. All the ck_epoch_xxx() functions, except ck_epoch_register(), ck_epoch_unregister() and ck_epoch_recycle() are not re-entrant and needs a critical section or a mutex to operate in the LinuxKPI, after inspecting the CK implementation of the above mentioned functions. The simultaneous issues arise from per-CPU epoch records being shared between multiple threads depending on the amount of taskswitching and how many threads are involved with the RCU and SRCU operations. - Properly free all epoch records by using safe list traversal at LinuxKPI module unload. It turns out the ck_epoch_recycle() always have the records on an internal list and use a flag in the epoch record to track allocated and free entries. This would lead to use after free during module unload. - Remove redundant synchronize_rcu() call from the linux_compat_uninit() function. Let the linux_rcu_runtime_uninit() function do the final rcu_barrier() instead. Sponsored by: Mellanox Technologies MFC r314675: Remove duplicate prototype in the LinuxKPI to fix compilation warning. Reported by: emaste @ Sponsored by: Mellanox Technologies MFC r314771: Give LinuxKPI Read-Write semaphores better debug names when WITNESS_ALL is defined. The lock name is based on the filename and line number where the initialisation happens. Sponsored by: Mellanox Technologies MFC r314772: Implement DECLARE_RWSEM() macro in the LinuxKPI to initialize a Read-Write semaphore during module init time. Sponsored by: Mellanox Technologies MFC r314774: Implement add_timer_on() function in the LinuxKPI. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r314843: LinuxKPI workqueue cleanup. This change makes the workqueue implementation behave more like in Linux, both functionality wise and structure wise. All workqueue code has been moved to linux_work.c Add an atomic based statemachine to the work_struct to ensure proper operation. Prior to this change struct_work was directly mapped to a FreeBSD task. When a taskqueue has multiple threads the same task may end up being executed on more than one worker thread simultaneously. This might cause problems with code coming from Linux, which expects serial behaviour, similar to Linux tasklets. Move all global workqueue function names into the linux_xxx domain to avoid symbol name clashes in the future. Implement a few more workqueue related functions and macros. Create two multithreaded taskqueues for the LinuxKPI during module load, one for time-consuming callbacks and one for non-time consuming callbacks. Sponsored by: Mellanox Technologies MFC r314853: Use grouptaskqueue for tasklets in the LinuxKPI. This avoids creating own per-CPU threads and also ensures the tasklet execution happens on the same CPU core invoking the tasklet. Sponsored by: Mellanox Technologies MFC r314859: Make sure jiffies value is cast to an integer in the LinuxKPI before doing millisecond conversion. Under FreeBSD jiffies are 32-bit. Sponsored by: Mellanox Technologies MFC r314861: Implement time_is_after_eq_jiffies() function in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r314904: Implement eth_zero_addr() in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r314905: Cleanup the LinuxKPI slab implementation. Put large functions into linux_slab.c instead of declaring them static inline. Add support for more memory allocation wrappers like kmalloc_array() and __vmalloc(). Make sure either the M_WAITOK or the M_NOWAIT flag is set and mask away unused memory allocation flags before calling FreeBSD's malloc() routine. Move kmalloc_node() definition to slab.h where it belongs. Implement support for the SLAB_DESTROY_BY_RCU feature when creating a kmem_cache which basically means kmem_cache memory is freed using call_rcu(). Sponsored by: Mellanox Technologies MFC r314920: Fix compilation warning for powerpc64 by not using const keyword in return types: Type qualifiers ignored on function return type [-Wreturn-type] Reported by: andreast @ Sponsored by: Mellanox Technologies MFC r314953: Don't create any threads before SI_SUB_INIT_IF in the LinuxKPI. Else kthread_add() will assert it is called too soon. This fixes a startup issue when COMPAT_LINUXKPI is in enabled the kernel configuration file. Reported by: Michael Butler <imb@protected-networks.net> Sponsored by: Mellanox Technologies MFC r314965: Cleanup the LinuxKPI mutex wrappers. Add support for using mutexes during KDB and shutdown. This is also required for doing mode-switching during panic for drm-next. Add new mutex functions mutex_init_witness() and mutex_destroy() allowing LinuxKPI mutexes to be tracked by witness. Declare mutex_is_locked() and mutex_is_owned() like inline functions to get cleaner warnings. These functions are used inside WARN_ON() statements which might look a bit odd if these functions get fully expanded. Give mutexes better debug names through the mutex_name() macro when WITNESS_ALL is defined. The mutex_name() macro can prefix parts of the filename and line number before the mutex name. Sponsored by: Mellanox Technologies MFC r314970: Implement support for mutexes with deadlock avoidance in the LinuxKPI. When locking a mutex and deadlock is detected the first mutex lock call that sees the deadlock will return -EDEADLK . Sponsored by: Mellanox Technologies MFC r314971: Fix implementation of the DECLARE_WORK() macro in the LinuxKPI to fully initialize the declared work structure and not only the function callback pointer. Sponsored by: Mellanox Technologies MFC r315244: Set "current" pointer for LinuxKPI interrupts and timer callbacks. Sponsored by: Mellanox Technologies MFC r315410: Define some more LinuxKPI task related macros. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r315419: Implement more userspace memory access functions in the LinuxKPI. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r315420: The LinuxKPI pagefault disable and enable functions can only be used pairwise to support the FreeBSD way of pushing and popping the page fault flags. Ensure this by requiring every occurrence of pagefault disable function call to have a corresponding pagefault enable call. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r315422: Use __LP64__ to detect presence of suword64() to fix linking and loading of the LinuxKPI on 32-bit platforms. Reported by: lwhsu @ Sponsored by: Mellanox Technologies MFC r315442: Add comment describing the use of pagefault_disable() and pagefault_enable() in the LinuxKPI. Suggested by: rpokala@ Sponsored by: Mellanox Technologies MFC r315443: Implement minimalistic memory mapping structure, struct mm_struct, and some associated helper functions in the LinuxKPI. Let the existing linux_alloc_current() function allocate and initialize the new structure and let linux_free_current() drop the refcount on the memory mapping structure. When the mm_struct's refcount reaches zero, the structure is freed. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r315457: Implement get_pid_task(), pid_task() and some other PID helper functions in the LinuxKPI. Add a usage atomic to the task_struct structure to facilitate refcounting the task structure when returned from get_pid_task(). The get_task_struct() and put_task_struct() function is used to manage atomic refcounting. After this change the task_struct should only be freed through put_task_struct(). Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r315713: Add support for more IPv4 and IPv6 related macros in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r315714: Add full VNET support to the inet_get_local_port_range() function in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r315719: Extend cmpxchg() to support 8- and 16-bit values, and add xchg(). These are needed to support updated revisions of the DRM code. Reviewed by: hselasky (previous version) MFC r315856: Add support for ratelimited printouts in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r315859: Function macros are preferred in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r315863: Add proper error checking for the string to number conversion functions in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r315864: Use ppsratecheck() for ratelimiting in the LinuxKPI. Suggested by: cem @ Sponsored by: Mellanox Technologies MFC r316033: Implement a series of physical page management related functions in the LinuxKPI for accessing user-space memory in the kernel. Add functions to hold and wire physical page(s) based on a given range of user-space virtual addresses. Add functions to get and put a reference on, wire, hold, mark accessed, copy and dirty a physical page. Add new VM related structures and defines as a preparation step for advancing the memory map capabilities of the LinuxKPI. Add function to figure out if a virtual address was allocated using malloc(). Add function to convert a virtual kernel address into its physical page pointer. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r316034: Add more platforms supporting the direct map feature in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r316035: Implement vmalloc_32() in the LinuxKPI. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r316521: Implement down_write_killable() in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r316522: Unify error handling when si_drv1 is NULL in the LinuxKPI. Make sure the character device poll callback function does not return an error code, but a POLLXXX value, in case of failure. Sponsored by: Mellanox Technologies MFC r316561: Before registering a new mm_struct in the LinuxKPI check if other tasks in the belonging procedure already have a valid mm_struct and reference that instead. The mm_struct in the LinuxKPI should be shared among all tasks belonging to the same procedure. This has to do with with the mmap_sem semaphore which should serialize all VM operations inside a given procedure. Linux based drivers depend on this behaviour. Sponsored by: Mellanox Technologies MFC r316562: Implement proper support for memory map operations in the LinuxKPI, like open, close and fault using the character device pager. Some notes about the implementation: 1) Linux drivers set the vm_ops and vm_private_data fields during a mmap() call to indicate that the driver wants to use the LinuxKPI VM operations. Else these operations are not used. 2) The vm_private_data pointer is associated with a VM area structure and inserted into an internal LinuxKPI list. If the vm_private_data pointer already exists, the existing VM area structure is used instead of the allocated one which gets freed. 3) The LinuxKPI's vm_private_data pointer is used as the callback handle for the FreeBSD VM object. The VM subsystem in FreeBSD has a similar list to identify equal handles and will only call the character device pager's close function once. 4) All LinuxKPI VM operations are serialized through the mmap_sem sempaphore, which is per procedure, which prevents simultaneous access to the shared VM area structure when receiving page faults. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r316563: Fix implementation of task_pid_group_leader() in the LinuxKPI. In FreeBSD thread IDs and procedure IDs have distinct number spaces. When asking for the group leader task ID in the LinuxKPI, return the procedure ID and let this resolve to the first task in the procedure having a valid LinuxKPI task structure pointer. Sponsored by: Mellanox Technologies MFC r316564: Implement need_resched() in the LinuxKPI. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r316565: Define VM_READ, VM_WRITE and VM_EXEC in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r316568: Cleanup the bitmap_xxx() functions in the LinuxKPI: - Move all bitmap related functions from bitops.h to bitmap.h, similar to what Linux does. - Apply some minor code cleanup and simplifications to optimize the generated code when using static inline functions. - Implement the following list of bitmap functions which are needed by drm-next and ibcore: - bitmap_find_next_zero_area_off() - bitmap_find_next_zero_area() - bitmap_or() - bitmap_and() - bitmap_xor() - Add missing include directives to the qlnxe driver (davidcs@ has been notified) Sponsored by: Mellanox Technologies MFC r316606: The __stringify() macro in the LinuxKPI should expand any macros before stringifying. Sponsored by: Mellanox Technologies MFC r316609: Create the LinuxKPI current task structure on the fly if it doesn't exist when the current macro is used. Sponsored by: Mellanox Technologies MFC r316656: Fix compilation of LinuxKPI for PowerPC. Found by: emaste @ Sponsored by: Mellanox Technologies MFC r317135: Zero number of CPUs should be translated into the default number of CPUs when allocating a LinuxKPI workqueue. This also ensures that the created taskqueue always have a non-zero number of worker threads. Sponsored by: Mellanox Technologies MFC r317137: Fix problem regarding priority inversion when using the concurrency kit, CK, in the LinuxKPI. When threads are pinned to a CPU core or when there is only one CPU, it can happen that a higher priority thread can call the CK synchronize function while a lower priority thread holds the read lock. Because the CK's synchronize is a simple wait loop this can lead to a deadlock situation. To solve this problem use the recently introduced CK's wait callback function. When detecting a CK blocking condition figure out the lowest priority among the blockers and update the calling thread's priority and yield. If another CPU core is holding the read lock, pin the thread to the blocked CPU core and update the priority. The calling threads priority and CPU bindings are restored before return. If a thread holding a CK read lock is detected to be sleeping, pause() will be used instead of yield(). Sponsored by: Mellanox Technologies MFC r317138: Use __typeof() instead of typeof() in some RCU related macros in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r317504: Prefer to use real virtual address over direct map address in the linux_page_address() function in the LinuxKPI. This solves an issue where the return value from linux_page_address() is passed to kmem_free(). Sponsored by: Mellanox Technologies MFC r317651: Add on_each_cpu() and wbinvd_on_all_cpus(). Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D10550 MFC r317828: Fix for use after free in the LinuxKPI. Background: The same VM object might be shared by multiple processes and the mm_struct is usually freed when a process exits. Grab a reference on the mm_struct while the vmap is in the linux_vma_head list in case the first process which inserted a VM object has exited. Tested by: kwm @ Sponsored by: Mellanox Technologies MFC r317839: Use pmap_invalidate_cache() to implement wbinvd_on_all_cpus(). Suggested by: jhb X-MFC with: r317651 MFC r318026: Fix init order in the LinuxKPI for RCU support. CPU_FOREACH() is not available until SI_SUB_CPU at SI_ORDER_ANY when the LinuxKPI is loaded as part of the kernel. Sponsored by: Mellanox Technologies MFC r318590: Add get_cpu() and put_cpu(). MFC r319229: Add some miscellaneous definitions to support DRM drivers. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D10985 MFC r319312: Make sure the thread's priority is restored for all three cases inside linux_synchronize_rcu_cb() in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r319316: Fixes for refcounting "struct linux_file" in the LinuxKPI. - Allow "struct linux_file" to be refcounted when its "_file" member is NULL by using its "f_count" field. The reference counts are transferred to the file structure when the file descriptor is installed. - Add missing vdrop() calls for error cases during open(). - Set the "_file" member of "struct linux_file" during open. This allows use of refcounting through get_file() and fput() with LinuxKPI character devices. Sponsored by: Mellanox Technologies MFC r319317: Fix a reference count leak in the LinuxKPI due to calling VM open when it shouldn't be called. Background: The Linux VM open operation is called when a new VMA is created on top of the current VMA. This is done through either mremap flow or split_vma, usually due to mlock, madvise, munmap and so on. This is currently not supported by the LinuxKPI. Sponsored by: Mellanox Technologies MFC r319318: Don't acquire a reference on the VM-space when allocating the LinuxKPI task structure to avoid deadlock when tearing down the VM object during a process exit. Found by: markj @ Sponsored by: Mellanox Technologies MFC r319319: Remove the VMA handle from its list before calling the LinuxKPI VMA close operation to prevent other threads from reusing the VM object handle pointer. Sponsored by: Mellanox Technologies MFC r319320: Make sure the VMAP's "vm_file" field is referenced in a Linux compatible way by the linux_dev_mmap_single() function in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r319321: Properly set the .d_name field in the cdevsw structure for the LinuxKPI. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r319338: Implement in_atomic() function in the LinuxKPI. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r319340: Properly implement idr_preload() and idr_preload_end() in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r319341: Implement print_hex_dump(), print_hex_dump_bytes() and printk_ratelimited() in the LinuxKPI. While at it fix the inclusion guard of printk.h to be similar to the rest of the LinuxKPI header files. Sponsored by: Mellanox Technologies MFC r319409: Add generic kqueue() and kevent() support to the LinuxKPI character devices. The implementation allows read and write filters to be created and piggybacks on the poll() file operation to determine when a filter should trigger. The piggyback mechanism is simply to check for the EWOULDBLOCK or EAGAIN return code from read(), write() or ioctl() system calls and then update the kqueue() polling state bits. The implementation is similar to the one found in the cuse(3) module. Refer to sys/fs/cuse/*.[ch] for more details. Sponsored by: Mellanox Technologies MFC r319410: Translate the ERESTARTSYS error code into ERESTART in the LinuxKPI ioctl(), read() and write() system call handlers. This error code is internal to the kernel and should not be seen by user-space programs according to Linux. Submitted by: Yanko Yankulov <yanko.yankulov@gmail.com> Sponsored by: Mellanox Technologies MFC r319444: Make sure the selrecord() function is only called from within system polling contexts in the LinuxKPI. After the kqueue() support was added to the LinuxKPI in r319409 the Linux poll file operation will be used outside the system file polling callback function, which can cause a NULL-pointer panic inside selrecord() because curthread->td_sel is set to NULL. This patch moves the selrecord() call away from poll_wait() and to the system file poll callback function in the LinuxKPI, which essentially wraps the Linux one. This is similar to what the cuse(3) module is currently doing. Refer to sys/fs/cuse/*.[ch] for more details. Sponsored by: Mellanox Technologies MFC r319500: Add support for setting the non-blocking I/O flag for LinuxKPI character devices. In Linux the FIONBIO IOCTL is handled by the kernel and not the drivers. Also need return success for the FIOASYNC ioctl due to existing logic in kern_fcntl() even though it is not supported currently. Sponsored by: Mellanox Technologies MFC r319501: Improve kqueue() support in the LinuxKPI. Some applications using the kqueue() does not set non-blocking I/O mode for event driven read of file descriptors. This means the LinuxKPI internal kqueue read and write event flags must be updated before the next read and/or write system call. Else the read and/or write system call may block. This can happen when there is no more data to read following a previous read event. Then the application also gets blocked from processing other events. This situation can also be solved by the applications setting and using non-blocking I/O mode. Sponsored by: Mellanox Technologies MFC r319620: Fix init order in the LinuxKPI for IDR support after recent changes. CPU_FOREACH() is not available until SI_SUB_CPU at SI_ORDER_ANY when the LinuxKPI is loaded as part of the kernel. Sponsored by: Mellanox Technologies MFC r319656: Add more #ifdef arch checks to the linuxkpi arm, mips, and powerpc all implement pmap_mapdev_attr() and pmap_unmapdev(), so add those archs to the checks. powerpc also includes the atomic_swap_*() functions, so add that to the supported list as well. Not tested except by compiling powerpc. Reviewed by: markj MFC r319675: Remove ARM and MIPS from linuxkpi ioremap_attr definition ARM and MIPS fail universe builds. ARM and MIPS are missing the following: * VM_MEMATTR_WRITE_THROUGH * VM_MEMATTR_WRITE_COMBINING Pointy-hat to: jhibbits MFC r319757: Augment wait queue support in the LinuxKPI. In particular: - Don't evaluate event conditions with a sleepqueue lock held, since such code may attempt to acquire arbitrary locks. - Fix the return value for wait_event_interruptible() in the case that the wait is interrupted by a signal. - Implement wait_on_bit_timeout() and wait_on_atomic_t(). - Implement some functions used to test for pending signals. - Implement a number of wait_event_*() variants and unify the existing implementations. - Unify the mechanism used by wait_event_*() and schedule() to put the calling thread to sleep. This is required to support updated DRM drivers. Thanks to hselasky for finding and fixing a number of bugs in the original revision. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D10986 MFC r319758: Implement pci_disable_device() in the LinuxKPI. Submitted by: kmacy MFC r320063: Remove prototypes for unimplemented LinuxKPI functions. MFC r320072: Avoid including list.h in LinuxKPI headers. list.h includes a number of FreeBSD headers as a workaround for the LIST_HEAD name collision. To reduce pollution, avoid including list.h in commonly used headers when it is not explicitly needed. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D11249 MFC r320078: Add kthread parking support to the LinuxKPI. Submitted by: kmacy (original version) Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D11264 MFC r320189: Allow the VM fault handler to be NULL in the LinuxKPI when handling a memory map request. When the VM fault handler is NULL a return code of VM_PAGER_BAD is returned from the character device's pager populate handler. This fixes compatibility with Linux. Sponsored by: Mellanox Technologies MFC r320192: Add a lockdep macro to the LinuxKPI. Also fix some nearby style issues. MFC r320193: Include kmod.h from the LinuxKPI's module.h. MFC r320194: Add missing lock destructor invocations to the LinuxKPI unload handler. MFC r320196: Update io-mapping.h in the LinuxKPI. Add io_mapping_init_wc() and add a third (unused) parameter to io_mapping_map_wc(). Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D11286 MFC r320333: Add noop_lseek() to the LinuxKPI. MFC r320334: Add the thaw_early method to struct dev_pm_ops in the LinuxKPI. MFC r320335: Add a couple of macros to lockdep.h in the LinuxKPI. MFC r320336: Add ns_to_ktime() to the LinuxKPI. MFC r320337: Add u64_to_user_ptr() to the LinuxKPI. MFC r320364: Implement parts of the hrtimer API in the LinuxKPI. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D11359 MFC r320580: Let io_mapping_init_wc() fall back to an uncacheable mapping. This allows usage of the function on architectures that don't support write-combining. Reported by: bz, emaste X-MFC With: r320196 MFC r320627: Hold the PCI device list lock when removing an element. MFC r320633: Rename the "driver" field to "bsddriver" to avoid a name collision. MFC r320634: Add some PCI class definitions. MFC r320635: Add a field for the class code to struct pci_driver. Fill out some previously uninitialized fields as well. MFC r320636: Add some auxiliary types for device driver support. MFC r320656: Invoke suspend/resume methods from the driver pmops if available. Obtained from: kmacy (original version) MFC r320774: Fix a bug in synchronize RCU when the calling thread is bound to a CPU. Set "td_pinned" to zero after "sched_unbind()" to prevent "td_pinned" from temporarily becoming negative during "sched_bind()". This can happen if "sched_bind()" uses "sched_pin()" and "sched_unpin()". Sponsored by: Mellanox Technologies MFC r320775: Complete r320189 which allows a NULL VM fault handler in the LinuxKPI. Instead of mapping a dummy page upon a page fault, map the page pointed to by the physical address given by IDX_TO_OFF(vmap->vm_pfn). To simplify the implementation use OBJT_DEVICE to implement our own linux_cdev_pager_fault() instead of using the existing linux_cdev_pager_populate(). Some minor code factoring while at it. Reviewed by: markj @ Sponsored by: Mellanox Technologies MFC r320810: Add TASK_COMM_LEN to the LinuxKPI. MFC r320811: Add device_is_registered() to the LinuxKPI. MFC r320812: Fix the definitions of pgprot_{noncached,writecombine} after r316562. MFC r320813: Add some helper definitions to fs.h in the LinuxKPI. Add a field to struct linux_file to allow the creation of anonymous shmem objects. MFC r320852: Free existing per-thread task structs when unloading linuxkpi.ko. They are otherwise leaked. Reported and tested by: ae MFC r320853: Add a few functions to ktime.h in the LinuxKPI, and fix nearby style. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D11534 MFC r320854: Add some functions to math64.h in the LinuxKPI, and fix nearby style. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D11535 MFC r320956: Add some functions to jiffies.h. Also add some checks for overflow to existing functions. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D11533 MFC r321773: Remove cycle_t type from the LinuxKPI similar to Linux upstream. Sponsored by: Mellanox Technologies MFC r321926: Fix LinuxKPI regression after r321920. The mda_unit and si_drv0 fields are not wide enough to hold the full 64-bit dev_t. Instead use the "dev" field in the "linux_cdev" structure to store and lookup this value. While at it remove superfluous use of parenthesis inside the MAJOR(), MINOR() and MKDEV() macros in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r322028: Add subsystem vendor and device ID fields to struct pci_dev. MFC r322169: Fix hrtimer_active() in case of cancellation. While there, switch to FreeBSD internal callout active status. Reviewed by: markj, hselasky Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D11900 MFC r322212: Add macros for defining attribute groups and for WO and RW attributes. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D11872 MFC r322213: Add round_jiffies_up(), local_clock() and __setup_timer() to the LinuxKPI. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D11871 MFC r322272: Fix few issues of LinuxKPI workqueue. LinuxKPI workqueue wrappers reported "successful" cancellation for works already completed in normal way. This change brings reported status and real cancellation fact into sync. This required for drm-next operation. Reviewed by: hselasky (earlier version) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D11904 MFC r322354: Make sure the linux_wait_event_common() function in the LinuxKPI properly handles a timeout value of MAX_SCHEDULE_TIMEOUT which basically means there is no timeout. This is a regression issue after r319757. While at it change the type of returned variable from "long" to "int" to match the actual return type. Sponsored by: Mellanox Technologies MFC r322355: Fixes for wait event in the LinuxKPI. These are regression issues after r319757. 1) Correct the return value from __wait_event_common() from 1 to 0 in case the timeout is specified as MAX_SCHEDULE_TIMEOUT. In the other case __ret is zero and will be substituted in the last part of the macro with the appropriate value before return. 2) Make sure the "timeout" argument is casted to "int" before evaluating negativity. Else the signedness of a "long" might be checked instead of the signedness of an integer. 3) The wait_event() function should not have a return value. Found by: KrishnamRaju ErapaRaju <Krishna2@chelsio.com> Sponsored by: Mellanox Technologies MFC r322357: Use integer type to pass around jiffies and/or ticks values in the LinuxKPI because in FreeBSD ticks are 32-bit. Sponsored by: Mellanox Technologies MFC r322392: Add a specialized function for DRM drivers to register themselves. Such drivers attach to a vgapci bus rather than directly to a pci bus. For the rest of the LinuxKPI to work correctly in this case, we override the vgapci bus' ivars with those of the grandparent. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D11932 MFC r322397: Make sure the "vm_flags" and "vm_page_prot" fields get set correctly in the VM area structure in the LinuxKPI when doing mmap() and that unsupported bits are masked away. While at it fix some redundant use of parenthesing inside some related macros. Found by: KrishnamRaju ErapaRaju <Krishna2@chelsio.com> Sponsored by: Mellanox Technologies MFC r322567: Add device resource management fields to struct device. MFC r322713: Add a couple of trivial headers to the LinuxKPI. MFC r322714: Define prefetch() only if it hasn't already been defined. MFC r322746: Fix for deadlock situation in the LinuxKPI's RCU synchronize API. Deadlock condition: The return value of TDQ_LOCKPTR(td) is the same for two threads. 1) The first thread signals a wakeup while keeping the rcu_read_lock(). This invokes sched_add() which in turn will try to lock TDQ_LOCK(). 2) The second thread is calling synchronize_rcu() calling mi_switch() over and over again trying to yield(). This prevents the first thread from running and releasing the RCU reader lock. Solution: Release the thread lock while yielding to allow other threads to acquire the lock pointed to by TDQ_LOCKPTR(td). Found by: KrishnamRaju ErapaRaju <Krishna2@chelsio.com> Sponsored by: Mellanox Technologies MFC r322795: Add some miscellaneous definitions to support the DRM drivers. MFC r322816: Set the bus number field when attaching a PCI device. MFC r323347: Add more sanity checks to linux_fget() in the LinuxKPI. This prevents returning pointers to file descriptors which were not created by the LinuxKPI. Sponsored by: Mellanox Technologies MFC r323349: Properly implement poll_wait() in the LinuxKPI. This prevents direct use of the linux_poll_wakeup() function from unsafe contexts, which can lead to use-after-free issues. Instead of calling linux_poll_wakeup() directly use the wake_up() family of functions in the LinuxKPI to do this. Bump the FreeBSD version to force recompilation of external kernel modules. Sponsored by: Mellanox Technologies MFC r323703: Add support for shared memory functions to the LinuxKPI. Obtained from: kmacy @ Sponsored by: Mellanox Technologies MFC r323704: Only wire pages in the LinuxKPI instead of holding and wiring them. This prevents the page daemon from regularly scanning the held pages. Suggested by: kib @ Sponsored by: Mellanox Technologies MFC r323705: The LinuxKPI atomics do not have acquire nor release semantics unless specified. Fix code to use READ_ONCE() and WRITE_ONCE() where appropriate. Suggested by: kib @ Sponsored by: Mellanox Technologies MFC r323910: Add support for 32-bit compatibility IOCTLs in the LinuxKPI. Bump the FreeBSD version to force recompilation of external kernel modules due to structure change. PR: 222504 Submitted by: Greg V <greg@unrelenting.technology> Sponsored by: Mellanox Technologies MFC r324278: Make sure the timer belonging to the delayed work in the LinuxKPI gets drained before invoking the work function. Else the timer mutex may still be in use which can lead to use-after-free situations, because the work function might free the work structure before returning. Sponsored by: Mellanox Technologies MFC r324285: Add get_random_{int,long} to the LinuxKPI. Fix some whitespace bugs while here. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D12588 MFC r324597: Don't call selrecord() outside the select system call in the LinuxKPI, because then td->td_sel is NULL and this will result in a segfault inside selrecord(). This happens when only using kqueue() to poll for read and write events. If select() and kqueue() is mixed there won't be a segfault. Reported by: Johannes Lundberg Sponsored by: Mellanox Technologies MFC r324606: Make the PHOLD in linux_wait_event_common() unconditional. After some in-progress work is committed, this would otherwise be the only instance of #if(n)def NO_SWAPPING in the tree. Moreover, the requisite opt_vm.h include was missing, so the PHOLD/PRELE calls were always being compiled in anyway. MFC r325279: Implement ioread16be() in the LinuxKPI. Sponsored by: Mellanox Technologies MFC r325360: Remove redundant dev->si_drv1 NULL checks in the LinuxKPI. This pointer is checked during the linux_dev_open() callback and does not need to be NULL checked again. It should always be set for character devices belonging to the "linuxcdevsw" and technically there is no need to NULL check this pointer at all. Suggested by: kib @ Sponsored by: Mellanox Technologies MFC r325635: Remove some not needed comments in the LinuxKPI. Use the Linux source tree to lookup documentation for the functions implemented in the LinuxKPI instead. Sponsored by: Mellanox Technologies MFC r325707: Mask away return codes from del_timer() and del_timer_sync() because they are not the same like in Linux. Sponsored by: Mellanox Technologies MFC r325708: Remove release and acquire semantics when accessing the "state" field of the LinuxKPI task struct. Change type of "state" variable from "int" to "atomic_t" to simplify code and avoid unneccessary casting. Sponsored by: Mellanox Technologies MFC r325767: Properly handle the case where the linux_cdev_handle_insert() function in the LinuxKPI returns NULL. This happens when the VM area's private data handle already exists and could cause a so-called NULL pointer dereferencing issue prior to this fix. Found by: greg@unrelenting.technology Sponsored by: Mellanox Technologies MFC r327676: linuxkpi: Implement kcalloc() based on mallocarray() This means we now get integer overflow protection, which Linux code might expect as it is also provided by kcalloc() in Linux. MFC r327788: linuxkpi: Simplify kmalloc_array. kmalloc_array seems what we call mallocarray(9). MFC r312926: (partial, no mergeinfo) Revert r312923 a better approach will be taken later MFC r312927: (partial, no mergeinfo) Revert crap accidentally committed MFC r316665: (partial, no mergeinfo) Import CK as of commit 6b141c0bdd21ce8b3e14147af8f87f22b20ecf32 This brings us changes we needed in ck_epoch. MFC r317053: (partial, no mergeinfo) Remove unneeded include of vm_phys.h. MFC r317055: (partial, no mergeinfo) All these files need sys/vmmeter.h, but now they got it implicitly included via sys/pcpu.h. MFC r322168: (partial, no mergeinfo) o Replace __riscv__ with __riscv o Replace __riscv64 with (__riscv && __riscv_xlen == 64) This is required to support new GCC 7.1 compiler. This is compatible with current GCC 6.1 compiler. RISC-V is extensible ISA and the idea here is to have built-in define per each extension, so together with __riscv we will have some subset of these as well (depending on -march string passed to compiler): __riscv_compressed __riscv_atomic __riscv_mul __riscv_div __riscv_muldiv __riscv_fdiv __riscv_fsqrt __riscv_float_abi_soft __riscv_float_abi_single __riscv_float_abi_double __riscv_cmodel_medlow __riscv_cmodel_medany __riscv_cmodel_pic __riscv_xlen Reviewed by: ngie Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11901 MFC r322672: (partial, no mergeinfo) Move some other SI_SUB_INIT_IF initializations to SI_SUB_TASKQ Drop the EARLY_AP_STARTUP gtaskqueue code, as gtaskqueues are now initialized before APs are started. Reviewed by: hselasky@, jhb@ Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12054 MFC r326984: (partial, no mergeinfo) Update Matthew Macy contact info Email address has changed, uses consistent name (Matthew, not Matt) Reported by: Matthew Macy <mmacy@mattmacy.io> Differential Revision: https://reviews.freebsd.org/D13537
OpenPOWER on IntegriCloud