aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* arm64: Hyper-V: making INTR MP SafeSouradeep Chakrabarti2022-11-041-1/+1
| | | | | | | | Makeing the interrupt MP safe. Reviewed by: andrew Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D37222
* mana(4): Make the code cross-platformLi-Wen Hsu2022-11-041-12/+3
| | | | | | Discussed with: whu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36388
* xen/netfront: deal with mbuf data crossing a page boundaryRoger Pau Monné2022-11-031-56/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | There's been a report recently of mbufs with data that crosses a page boundary. It seems those mbufs are generated by the iSCSI target system: https://lists.xenproject.org/archives/html/xen-devel/2021-12/msg01581.html In order to handle those mbufs correctly on netfront use the bus_dma interface and explicitly request that segments must not cross a page boundary. No other requirements are necessary, so it's expected that bus_dma won't need to bounce the data and hence it shouldn't introduce a too big performance penalty. Using bus_dma requires some changes to netfront, mainly in order to accommodate for the fact that now ring slots no longer have a 1:1 match with mbufs, as a single mbuf can use two ring slots if the data buffer crosses a page boundary. Store the first packet of the mbuf chain in every ring slot that's used, and use a mbuf tag in order to store the bus_dma related structures and a refcount to keep track of the pending slots before the mbuf chain can be freed. Reported by: G.R. Tested by: G.R. MFC: 1 week Differential revision: https://reviews.freebsd.org/D33876
* vtblk: Fix dumpingColin Percival2022-11-031-3/+17
| | | | | | | | | | | | | | Now that vtblk uses busdma, it keeps important information inside its request structures. The functions used for kernel dumps synthesize their own request structures rather than using structures initialized with the necessary bits for busdma. Add busdma-bypass paths. Since dumping writes contiguous blocks of physical memory, vtblk doesn't need busdma in that case. Reported by: glebius Tested by: glebius Differential Revision: https://reviews.freebsd.org/D37243
* sys: Nuke double-semicolonsElliott Mitchell2022-11-026-6/+6
| | | | | | | | | A distinct number of double-semicolons have ended up in FreeBSD. Take a pass at getting rid of many of these harmless typos. Reviewed by: emaste, rrs Pull Request: https://github.com/freebsd/freebsd-src/pull/609 Differential Revision: https://reviews.freebsd.org/D31716
* vmw_pvscsi: Expand vcpuHint to 16 bit to aliagn with host side change.Wentao Wang2022-11-021-2/+2
| | | | | | | | | | | | | | | vcpuHint has been expanded to 16 bit on host side to enable interruptions to be routed to more CPUs. Guest side should align with the change. This change has been tested with hosts with 8-bit and 16-bit vcpuHint, on both platforms host side can get correct value. This driver is for ESXi product which only supports x86/x64. They are little-endian. So there is no need to consider big-endian system. PR: 264840 Reviewed by: imp@, Zhenlei Huang
* ipmi: use a queue for kcs driver requests when possibleChuck Silvers2022-11-013-4/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ipmi watchdog pretimeout action can trigger unintentionally in certain rare, complicated situations. What we have seen at Netflix is that the BMC can sometimes be sent a continuous stream of writes to port 0x80, and due to what is a bug or misconfiguration in the BMC software, this results in the BMC running out of memory, becoming very slow to respond to KCS requests, and eventually being rebooted by its own internal watchdog. While that is going on in the BMC, back in the host OS, a number of requests are pending in the ipmi request queue, and the kcs_loop thread is working on processing these requests. All of the KCS accesses to process those requests are timing out and eventually failing because the BMC is responding very slowly or not at all, and the kcs_loop thread is holding the IPMI_IO_LOCK the whole time that is going on. Meanwhile the watchdogd process in the host is trying to pat the BMC watchdog, and this process is sleeping waiting to get the IPMI_IO_LOCK. It's not entirely clear why the watchdogd process is sleeping for this lock, because the intention is that a thread holding the IPMI_IO_LOCK should not sleep and thus any thread that wants the lock should just spin to wait for it. My best guess is that the kcs_loop thread is spinning waiting for the BMC to respond for so long that it is eventually preempted, and during the brief interval when the kcs_loop thread is not running, the watchdogd thread notices that the lock holder is not running and sleeps. When the kcs_loop thread eventually finishes processing one request, it drops the IPMI_IO_LOCK and then immediately takes the lock again so it can process the next request in the queue. Because the watchdogd thread is sleeping at this point, the kcs_loop always wins the race to acquire the IPMI_IO_LOCK, thus starving the watchdogd thread. The callout for the watchdog pretimeout would be reset by the watchdogd thread after its request to the BMC watchdog completes, but since that request never processed, the pretimeout callout eventually fires, even though there is nothing actually wrong with the host. To prevent this saga from unfolding: - when kcs_driver_request() is called in a context where it can sleep, queue the request and let the worker thread process it rather than trying to process in the original thread. - add a new high-priority queue for driver requests, so that the watchdog patting requests will be processed as quickly as possible even if lots of application requests have already been queued. With these two changes, the watchdog pretimeout action does not trigger even if the BMC is completely out to lunch for long periods of time (as long as the watchdogd check command does not also get stuck). Sponsored by: Netflix Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36555
* arm64: Hyper-V: fixing hung issue during Hyper-V initializationSouradeep Chakrabarti2022-11-011-1/+41
| | | | | | | | | | | In non-Hyper-V systems during Hyper-V initialization, system initialization was getting hung, as hyperv_identify(), was returning successful irrespective of the type of the platform. Reviewed by: andrew, whu Fixes: 9729f076e4d Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D37219
* isci(4): Fix common typos in source code commentsGordon Bergling2022-11-014-6/+6
| | | | | | - s/assinged/assigned/ MFC after: 3 days
* isci(4): Fix a typo in a source code commentGordon Bergling2022-11-011-1/+1
| | | | | | - s/interrutp/interrupt/ MFC after:3 days
* bxe(4): Fix a typo in a source code commentGordon Bergling2022-11-011-1/+1
| | | | | | - s/interrutps/interrupts/ MFC after: 3 days
* iommu_gas: drop fini cleanup loopDoug Moore2022-10-291-12/+4
| | | | | | | | | Assertions suggest that the loop in iommu_gas_fini_domain is executed zero times, so remove it. Reviewed by: alc, kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D37204
* iommu_gas: start space search from 1st free spaceDoug Moore2022-10-292-20/+52
| | | | | | | | | | | | | | | | | | Maintain a pointer to an element in the domain map that is left of any sufficiently large free gap in the tree and start the search for free space there, rather than at the root of the tree. On find_space, move that pointer to the leftmost leaf in the subtree of nodes with free_down greater than or equal to the minimum allocation size before starting the search for space from that pointer. On removal of a node with address less than that pointer, update that pointer to point to the predecessor or successor of the removed node. In experiments with netperf streaming, this reduces by about 40% the number of map entries examined in first-fit allocation. Reviewed by: alc, kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D36624
* wg: Trim compat shims for versions older than current stable/13.John Baldwin2022-10-283-1761/+52
| | | | | | Reviewed by: kevans, markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36913
* wg: Retire now unused support.h.John Baldwin2022-10-283-23/+0
| | | | | | Reviewed by: kevans, markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36912
* wg: Use zfree.John Baldwin2022-10-282-10/+5
| | | | | | Reviewed by: kevans, markj, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36911
* wg: Use atomic(9) instead of concurrency-kit atomics.John Baldwin2022-10-282-63/+65
| | | | | | | | | Kernel sanitizers only support atomic(9) operations. Reviewed by: kevans, markj, emaste Reported by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36910
* Import the WireGuard driver from zx2c4.com.John Baldwin2022-10-2811-0/+7357
| | | | | | | | | | | | | | | This commit brings back the driver from FreeBSD commit f187d6dfbf633665ba6740fe22742aec60ce02a2 plus subsequent fixes from upstream. Relative to upstream this commit includes a few other small fixes such as additional INET and INET6 #ifdef's, #include cleanups, and updates for recent API changes in main. Reviewed by: pauamma, gbe, kevans, emaste Obtained from: git@git.zx2c4.com:wireguard-freebsd @ 3cc22b2 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36909
* ns8250: Fix sense of LSR_TEMT FCR checkColin Percival2022-10-281-1/+1
| | | | | | | | | When flushing the UART, we need to drain manually if LSR_TEMT is *not* asserted, aka. if the transmit FIFO is not empty. Reported by: void <void@f-m.fm> Fixes: c4b68e7e53bb "ns8250: Check if flush via FCR succeeded" Differential Revision: https://reviews.freebsd.org/D37185
* Only include regdev_if.h when it's neededAndrew Turner2022-10-281-0/+2
| | | | | | We don't need to include regdev_if.h when not building for FDT. Sponsored by: Innovate UK
* Fix the includes in regulator_fixed.cAndrew Turner2022-10-281-1/+2
| | | | | | | Include sys/bus.h directly rather than depend on header pollution. While here fix the order of sys/systm.h. Sponsored by: Innovate UK
* Only include phydev_if.h when neededAndrew Turner2022-10-282-2/+2
| | | | | | | We only need to include phydev_if.h in phy.c when FDT is enabled and don't need it at all in phy_usb.c. Sponsored by: Innovate UK
* Include sys/systm.h in phy_usb.c for KASSERTAndrew Turner2022-10-281-0/+1
| | | | | | Rather than depending on header pollution include systm.h directly. Sponsored by: Innovate UK
* Allow clk_fixed.c to be built without FDTAndrew Turner2022-10-281-0/+4
| | | | | | | Include opt_platform.h to get the FDT definition and only include FDT headers when FDT is defined. Sponsored by: Innovate UK
* Remove unneeded headers from clk_link.cAndrew Turner2022-10-281-2/+0
| | | | | | | There is no OFW/FDT specific code in this file so the ofw headers can be removed. Sponsored by: Innovate UK
* Make sure error is defined in dpaa2Andrew Turner2022-10-271-1/+1
| | | | | | | The error variable is used in both the ACPI and FDT paths. Declare it unconditionally. Sponsored by: The FreeBSD Foundation
* Allow the extres regulator code to build without FDTAndrew Turner2022-10-272-1/+3
| | | | | | This allows drivers that use this to build in an ACPI only kernel. Sponsored by: The FreeBSD Foundation
* Fix xdma_if.m in an ACPI only kernelAndrew Turner2022-10-271-0/+4
| | | | | | | | - We depend on header polution to include sys/malloc.h. Include it directly. - Only define FDT-specific fuctions when building a FDT kernel. Sponsored by: Innovate UK
* arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 3, final)Souradeep Chakrabarti2022-10-2711-546/+120
| | | | | | | | | | | | This is the last part for ARM64 Hyper-V enablement. This includes commone files and make file changes to enable the ARM64 FreeBSD guest on Hyper-V. With this patch, it should be able to build the ARM64 image and install it on Hyper-V. Reviewed by: emaste, andrew, whu Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D36744
* psci: set psci_present as early as possibleKyle Evans2022-10-271-1/+1
| | | | | | | | | | | | | | | | | psci_attach is way too late to provide the intended semantics for psci_present. psci calls can be made immediately after psci_init(), called way earlier at SI_SUB_CPU + SI_ORDER_FIRST, and we need it to be valid as early as we can possibly call a psci function. This fixes booting RPi3+4 with the in-review spintable patch; rpi3-psci-monitor patches the FDT to add a PSCI node, but it doesn't patch each cpus' enable-method. Because of this, we would stall the boot while enabling CPU 1 as we saw a valid looking enable-method and "no" functional PSCI and attempted to use the spintable rather than simply not starting secondary APs. Fixes: 2218070b2c3c32 ("psci: finish psci_present implementation") Reported by: karels
* qlnxe(4): Fix a typo in a source code commentGordon Bergling2022-10-261-1/+1
| | | | | | - s/defult/default/ MFC after: 3 days
* Hyper-V: Code refactor to avoid redundancy of MSR values on x86 and arm64Souradeep Chakrabarti2022-10-268-291/+185
| | | | | | | | | Refactor the code to put split the MSR values for x86 and arm64 Hyper-V. Code not yet built. This is one of several patches for the arm64 Hyper-V enablement. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D37103
* vnic: work_done here only used for debugWarner Losh2022-10-251-1/+6
| | | | Sponsored by: Netflix
* smartpqi(4): Fix two typos in kernel error messagesGordon Bergling2022-10-252-2/+2
| | | | | | - s/runnning/running/ MFC after: 2 weeks
* arcmsr(4): Fix a typo in a source code commentGordon Bergling2022-10-251-1/+1
| | | | | | - s/faild/failed/ MFC after: 3 days
* firewire(4): Fix a typo in an error messageGordon Bergling2022-10-251-1/+1
| | | | | | - s/faild/failed/ MFC after: 5 days
* ocs_fc(4): Fix a typo in an error messageGordon Bergling2022-10-251-1/+1
| | | | | | - s/faild/failed/ MFC after: 5 days
* dpaa2: cleanup some include filesBjoern A. Zeeb2022-10-241-1/+0
| | | | | | | | | | 2782ed8f6cd3d7f59219a783bc7fa7bbfb1fe26f fixed the standalone module build. REmove the now duplicate includes for opt_acpi.h and opt_platform.h. Als remove the if_mdio.h again in both the Makefile and the implementation file as it is not (currently) used. X-MFC with: ba7319e9091b4f6ef15a9c4be3d3d076f3047f72 MFC after: 70 days
* acpi_ged: fix build with ACPI_DEBUGGleb Smirnoff2022-10-241-1/+1
|
* acpi_ged: fix build, as module and non INTRNG case.Takanori Watanabe2022-10-241-1/+1
| | | | | | Reviewed-by: cy Differential Revision: https://reviews.freebsd.org/D37104
* acpi_ged: New driver to ACPI generic event deviceTakanori Watanabe2022-10-241-0/+267
| | | | | | | | | | | | | | | | New driver to ACPI generic event device, defined in ACPI spec. Some ACPI power button may not work without this. In qemu arm64 with "virt" machine, with ACPI firmware, enable devd check devd message by and invoke following command in qemu monitor (qemu) system_powerdown and make sure some power button input event appear. (setting sysctl hw.acpi.power_button_state=S5 is not work, because ACPI tree does not have \_S5 object.) Reviewed by: andrew, hrs Differential Revision: https://reviews.freebsd.org/D37032
* arm64: Hyper-V: fix couple more commit errors caused by duplicated linesWei Hu2022-10-242-288/+0
| | | | | | | | Remove those duplicated lines. Reported by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Fixes: 6cf00ef80c20148 Sponsored by: Microsoft
* acpi: Create cppc_notify sysctl before it is checkedTom Jones2022-10-231-8/+8
| | | | | | Reported by: Henrix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D37081
* arm64: Hyper-V: fix a commit error caused duplicated lines in vmbus_aarch64.cWei Hu2022-10-211-157/+0
| | | | | | | | Remove those duplicated lines. Reported by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Fixes: 6cf00ef80c20148 Sponsored by: Microsoft
* arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 2)Souradeep Chakrabarti2022-10-214-0/+670
| | | | | | | | | | | This is the second part of the ARM64 Hyper-V enablement. These changes here are mostly with Make, release changes and also changes required in vmbus.c hyperv.c and common files in hyperv. Reviewed by: whu Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D36467
* arm64: Hyper-V: vmbus: use the IRQ resource from vmbus_resSouradeep Chakrabarti2022-10-211-1/+3
| | | | | | | | | | In ARM64 gen2 Hyper-V, use IRQ resource from vmbus_res, which is owning the IRQ for current device tree. It allows the MMIO resource to be successfully allocated for vmbus from parent acpi_syscontainer. Reviewed by: whu Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D37064
* xhci(4): Don't allocate an IRQ vector if hw.usb.xhci.use_polling=1 is set.Hans Petter Selasky2022-10-201-1/+1
| | | | | | | This is useful for debugging purposes. MFC after: 1 week Sponsored by: NVIDIA Networking
* Add random VMware device IDs.Alexander Motin2022-10-208-0/+35
| | | | | | Just to make dmesg look nicer there. MFC after: 1 week
* cxgbe: include headers required to include t4_tom.hGleb Smirnoff2022-10-191-0/+2
| | | | | Before the change we would get struct tcpcb forward declaration only with help of pollution via in_pcb.h.
* cxgbe: use standard sototcpcb() accessor macro to get socket's tcpcbGleb Smirnoff2022-10-194-8/+8
| | | | | Reviewed by: np Differential revision: https://reviews.freebsd.org/D37041