aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/vmd
Commit message (Collapse)AuthorAgeFilesLines
* bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin2025-12-091-4/+4
| | | | | | | | | The wrapper functions such as bus_alloc_resource_any() still support passing the rid by value or pointer, but the underlying implementation now passes by value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53402
* Remove now-redundant calls to device_delete_childrenJohn Baldwin2025-01-021-3/+0
| | | | | | | Earlier calls to bus_generic_detach now take care of deleting children. Differential Revision: https://reviews.freebsd.org/D47962
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-1/+2
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-251-2/+1
| | | | Sponsored by: Netflix
* acpi/pci/vmd: Fix a nit with nested resource mapping requestsJohn Baldwin2024-06-041-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some bus drivers use rmans to suballocate resources to child devices. When the driver for a child device requests a mapping for a suballocated resource, the bus driver translates this into a mapping request for a suitable subrange of the original resource the bus driver allocated from its parent. This nested mapping request should look like any other resource mapping request being made by the bus device (i.e. as if the bus device had called bus_map_resource() or bus_alloc_resource() with RF_ACTIVE). I had slightly flubbed this last bit though since the direct use of bus_generic_map/unmap_resource passed up the original child device (second argument to the underlying kobj interface). While this is currently harmless, it is not strictly correct as the resource being mapped is owned by the bus device, not the child and can break for other bus drivers in the future. Instead, use bus_map/unmap_resource for the nested request where the requesting device is now the bus device that owns the parent resource. Reviewed by: imp Fixes: 0e1246e33461 acpi: Cleanup handling of suballocated resources Fixes: b377ff8110e3 pcib: Refine handling of resources allocated from bridge windows Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation Fixes: d714e73f7895 vmd: Use bus_generic_rman_* for PCI bus and memory resources Differential Revision: https://reviews.freebsd.org/D45433
* new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCEJohn Baldwin2024-03-131-6/+4
| | | | | | | | | | The public bus_release_resource() API still accepts both forms, but the internal kobj method no longer passes the arguments. Implementations which need the rid or type now use rman_get_rid() or rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44131
* new-bus: Remove the 'rid' and 'type' arguments from BUS_*ACTIVATE_RESOURCEJohn Baldwin2024-03-131-12/+8
| | | | | | | | | | The public bus_activate/deactivate_resource() API still accepts both forms, but the internal kobj methods no longer pass the arguments. Implementations which need the rid or type now use rman_get_rid() or rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44130
* new-bus: Remove the 'type' argument from BUS_MAP/UNMAP_RESOURCEJohn Baldwin2024-03-131-4/+4
| | | | | | | | | | The public bus_map/unmap_resource() API still accepts both forms, but the internal kobj methods no longer pass the argument. Implementations which need the type now use rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44129
* new-bus: Remove the 'type' argument from BUS_ADJUST_RESOURCEJohn Baldwin2024-03-131-6/+4
| | | | | | | | | | The public bus_adjust_resource() API still accepts both forms, but the internal kobj method no longer passes the argument. Implementations which need the type now use rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44128
* vmd: Use bus_generic_rman_* for PCI bus and memory resourcesJohn Baldwin2024-02-151-25/+108
| | | | | | | | | While here, add custom bus_map/unmap_resource methods to request mappings via the window memory resources allocated from the parent bus. Tested by: emaste Differential Revision: https://reviews.freebsd.org/D43886
* vmd: Use bus_read/write_* instead of bus_space_read/write_*John Baldwin2024-02-152-17/+6
| | | | | | | Using an explicit bus space tag and handle is deprecated. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D43885
* vmd(4): Fix typos in source code commentsGordon Bergling2024-01-221-3/+3
| | | | | | - s/harwdare/hardware/ MFC after: 3 days
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* vmd: Add DID 8086:7D0B and 8086:AD0B for Intel MTL SKUsAlexander Motin2022-10-061-0/+2
| | | | MFC after: 2 weeks
* vmd: Bypass MSI/MSI-X remapping when possible.Alexander Motin2022-10-061-2/+57
| | | | | | | | | By default all VMD devices remap children MSI/MSI-X interrupts into their own. It creates additional isolation, but also complicates things due to sharing, etc. Fortunately some VMD devices can bypass the remapping. Add tunable to control it for remap testing or if something go wrong. MFC after: 2 weeks
* vmd: Add 8086:A77F PCI ID for all Intel Raptor Lake SKUsNeel Chauhan2022-07-291-0/+1
| | | | | | | | | | Summary: This is based on the Linux kernel commit 922bfd001d1ac02111ebbe0524aaab6ca7925521. Reviewed by: mav (src) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D35996
* vmd: Remove unused devclass argument to DRIVER_MODULE.John Baldwin2022-05-061-3/+1
|
* Missed line from 7af4475a6e31.Alexander Motin2021-09-031-0/+1
| | | | MFC after: 2 weeks
* vmd(4): Major driver refactoringAlexander Motin2021-09-033-637/+345
| | | | | | | | | | | | | | | | | | | | | | | | | | - Re-implement pcib interface to use standard pci bus driver on top of vmd(4) instead of custom one. - Re-implement memory/bus resource allocation to properly handle even complicated configurations. - Re-implement interrupt handling to evenly distribute children's MSI/ MSI-X interrupts between available vmd(4) MSI-X vectors and setup them to be handled by standard OS mechanisms with minimal overhead, except sharing when unavoidable. Successfully tested on Dell XPS 13 laptop with Core i7-1185G7 CPU (VMD device ID 0x9a0b) and single NVMe SSD, dual-booting with Windows 10. Successfully tested on Supermicro X11DPI-NT motherboard with Xeon(R) Gold 6242R CPUs (VMD device ID 0x201d), simultaneously handling NVMe SSD on one PCIe port and PLX bridge with 3 NVMe and 1 AHCI SSDs on another. Handles SSD hot-plug (except Optane 905p for some reason, which are not detected until manual bus rescan) and enabled IOMMU (directly connected SSDs work, but ones connected to the PLX fail without errors from IOMMU). MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential revision: https://reviews.freebsd.org/D31762
* vmd_bus: Fix typo in commentNeel Chauhan2021-07-181-2/+2
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D31210
* vmd: Rename vmd_bus class to pciNeel Chauhan2021-07-161-2/+2
| | | | | | | | | | This fixes a kernel panic when probing for vmd_bus on Intel TigerLake on 14-CURRENT. Apparently, vmd_bus is a type of PCI bus, but was registered as a separate device class. PR: 256915 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D31071
* Add support for some more Intel VMD controllers. Some of theDoug Ambrisko2021-01-283-36/+113
| | | | | | | | | | | | | | | | | | | | | | | newer controller have a sparce bus space that can be figured out by probing the HW. This gives the starting bus number. When reading the PCI config. space behind the VMD controller, the offset of the starting bus needs to be subtracted from the bus being read. Fixed a bug in which in which not all of the devices directly attached to the VMD controller would be probed. On my initial test HW, a switch was found at bus 0, slot 0 and function 0. All of the NVME drives were behind that switch. Now scan for all slots and functions attached to bus 0. If a something was found then run attach after the scan. On detach also go through all slots and functions on bus 0. Tested with device ID's: 0x201d & 0x9a0b Tested by: nc@ MFC after: 7 days PR: 252253
* vmd: Clean up resources properly when vmd_attach() failsMark Johnston2021-01-081-6/+6
| | | | | | | | - Free the resource container by calling rman_fini().[1] - Call device_delete_child() if device_probe_and_attach() fails. Reported by: nc [1] MFC after: 2 weeks
* vmd: clean up empty lines in .c and .h filesMateusz Guzik2020-09-012-5/+1
| | | | Notes: svn path=/head/; revision=365137
* This driver attaches to the Intel VMD drive and connects a new PCI domainDoug Ambrisko2019-10-103-0/+921
starting at the max. domain, and then work down. Then existing FreeBSD drivers will attach. Interrupt routing from the VMD MSI-X to the NVME drive is not well known, so any interrupt is sent to all children that register. VROC used Intel meta data so graid(8) works with it. However, graid(8) supports RAID 0,1,10 for read and write. I have some early code to support writes with RAID 5. Note that RAID 5 can have life issues with SSDs since it can cause write amplification from updating the parity data. Hot plug support needs a change to skip the following check to work: if (pcib_request_feature(dev, PCI_FEATURE_HP) != 0) { in sys/dev/pci/pci_pci.c. Looked at by: imp, rpokala, bcr Differential Revision: https://reviews.freebsd.org/D21383 Notes: svn path=/head/; revision=353380