summaryrefslogtreecommitdiffstats
path: root/sys/arch/amd64/pci (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spellingjsg2021-03-112-4/+4
|
* Allocate address space for reposting vga devices using km_alloc(9) ratherjmatthew2021-01-031-7/+9
| | | | | | than uvm_km_valloc(9). ok kettenis@
* Adding IOMMU support for AMD Vi and Intel VTD (disabled)jordan2020-10-271-2/+17
| | | | | | | This creates separate domains for each PCI device and can provide protection against invalid memory access. Needed for Passthrough PCI from vmd. ok deraadt@, kettenis@ : ----------------------------------------------------------------------
* Stop printing the extents for release.kettenis2020-09-261-2/+2
| | | | ok deraadt@
* pci_intr_establish_cpu() for establishing an interrupt no a specific cpu.dlg2020-06-171-4/+13
| | | | | | | | | | | | | | | | | | | the cpu is specified by a struct cpu_info *, which should generally come from an intrmap. this is adapted from a diff that patrick@ sent round a few years ago for a pci_intr_map_msix_cpuid, where you asked for an msi vector on a specific cpu, and then called pci_intr_establish with the handle you get. kettenis pointed out that it's hard on some archs to carry cpu on a pci interrupt handle, so i tweaked it to turn it into a pci_intr_establish_cpu instead. jmatthew@ and i (but mostly jmatthew@ to be honest) have been experimenting with this api on multiple archs and it is working out well. i'm putting this diff in now on amd64 so people can kick the tyres a bit. tested with hacked up vmx(4), ix(4), and mcx(4)
* dev/rndvar.h no longer has statistical interfaces (removed during variousderaadt2020-05-291-3/+1
| | | | | | conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
* Bring back the acpi(4) changes. This time around only use the ACPI _CRSkettenis2020-05-142-68/+234
| | | | | | information on ACPI 5.0 and later. ok krw@, patrick@
* remove AMD64 strings from pcidevsjsg2020-01-041-3/+3
| | | | ok mortimer@ mpi@ deraadt@
* Revert acpipci(4) changes. Too many systems are broken. We'll try againkettenis2019-09-072-175/+26
| | | | after 6.6 as been released. The acpireg.h change stays behind.
* Use ACPI information to attach PCI busses like we do on arm64. There are akettenis2019-08-282-26/+175
| | | | | | | | | | | few additional quirks though, and attaching the PCI busses is delayed to replicate the existing code more closely. That may be changed in the future. Also tweak how we handle MSI support and respect to ACPI flag that says we shouldn't attempt to use MSIs. Some fallout is expected. ok patrick@
* Implement suspend/resume support for MSI-X interrupts. Loosely based onkettenis2019-06-251-29/+54
| | | | | | an earlier diff from sf@. ok jmatthew@, also ok mlarkin@, sf@ for a slightly different earlier version
* Use two 32-bit writes instead of a single 64-bit write to write thekettenis2019-05-301-2/+3
| | | | | | | | | message address into an MSI-X table entry. The RTL8168/RTL8111 hardware does not respond to 64-bit access (reads return all-ones, writes are ignored) and the PCI specification documents separate 32-bit "DWORD" fields for message address and message upper address. ok mlarkin@, jmatthew@
* Add acpipci(4) on amd64. For now this only calls the PCI-specific _OSCkettenis2018-10-261-0/+133
| | | | method to let the ACPI implementation know what features we support.
* Add support for multiple PCI segments. Only really implemented for arm64kettenis2018-08-191-7/+15
| | | | | | | for now as amd64/i386 firmware still caters for legacy OSes that only support a single PCI segment. ok patrick@
* Properly pass around the PCI "chipset tag" in acpi(4) and refactorkettenis2018-07-041-3/+13
| | | | | | | acpimcfg(4) to call an MD initialization functions that sets up a tag for PCI ECAM. ok guenther@, mlarkin@, krw@
* replace add_*_randomness with enqueue_randomness()jasper2018-04-281-2/+2
| | | | | | | | | this gets rid of the source annotation which doesn't really add anything other than adding complexitiy. randomess is generally good enough that the few extra bits that the source type would add are not worth it. ok mikeb@ deraadt@
* reduce the amount of includes in arch/amd64jsg2017-10-143-11/+3
| | | | ok mpi@ deraadt@
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-081-2/+1
|
* Fix two issues in the MSI-X code. First, actually read the MSI-X capabilitykettenis2016-06-021-5/+5
| | | | | | | register. Second, correctly decode the table sizefromits contents. First issue pointed out by David Hill (with the help of clang). Second issue spotted after seeing a diff from Christiano Hasbaert.
* Fix typo; M_NOWAIT should be EX_NOWAIT. Fortunately this was harmless.kettenis2016-05-141-2/+2
|
* Initial support for MSI-X. Only supported on amd64 for now. I have diffs tokettenis2016-05-041-1/+144
| | | | | | | | | | actually use this in em(4) and xhci(4), but I'm not committing those yet because we almost certainly need to save and restore the MSI-X registers during suspend/resume. However, this allows mpi@ to play with multiple-vector support in networking hardware. Requested by mpi@ ok mlarkin@, mikeb@
* fairly simple sizes for free(); ok teduderaadt2015-08-281-3/+3
|
* Remove some includes include-what-you-use claims don'tjsg2015-03-144-8/+4
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* Add bus_dmamem_alloc_range(9) to allow drivers to allocate DMA'able memorykettenis2015-01-241-1/+2
| | | | | | within a range that is more (or less) restrictive than the default range. ok deraadt@, stsp@
* Temporarily expand the pci memory range to suit Dell 13G servers.jmatthew2014-12-161-3/+7
| | | | | | | | They have devices outside the 36 bit range that their firmware needs to talk to, and they get constant acpi interrupts if it can't. We should get the necessary ranges via ACPI, but for now just make the allowed range bigger. ok kettenis@ deraadt@
* Replace a plethora of historical protection options with justderaadt2014-11-161-4/+4
| | | | | | | PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
* On i386, agp_map_subregion might sleep, which is not allowed in some ofkettenis2014-09-201-6/+16
| | | | | | | the inteldrm code. Fix this by adding new interfaces that can map a single page without sleeping and use that in the execbuffer fast path that needs this "atomic" behaviour. Should fix the panic I've seen under memory pressure on i386.
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-122-6/+6
| | | | after discussions with beck deraadt kettenis.
* Don't panic if we're trying to disestablish an MSI but the hardware is gone.kettenis2014-04-191-4/+3
| | | | tested by & ok mlarkin@
* No need for <uvm/uvm_page.h>mpi2014-04-081-3/+2
|
* More <uvm/uvm.h> -> <uvm/uvm_extern.h> cleaning.mpi2014-04-011-3/+4
| | | | ok kettenis@, deraadt@
* No need to include <sys/lock.h> when only <sys/rwlock.h> is needed,mpi2014-03-262-3/+4
| | | | | | so remove the former and include the latter instead of pulling it in <dev/pci/agpvar.h>. This header already requires various other types anyway. While here remove unneeded headers.
* Remove MD intagp(4) code that is unused now that inteldrm(4) manages the GTTkettenis2013-12-091-129/+1
| | | | all by itself.
* Remove the agp-specific bus_dma code. It is no longer used now thatkettenis2013-12-071-104/+1
| | | | | | inteldrm(4) manages the GTT by itself. ok miod@
* Add a DVACT_WAKEUP op to the *_activate() API. This is called after thederaadt2013-12-061-10/+4
| | | | | | | | kernel resumes normal (non-cold, able to run processes, etc) operation. Previously we were relying on specific DVACT_RESUME op's in drivers creating callback/threads themselves, but that has become too common, indicating the need for a built-in mechanism. ok dlg kettenis, tested by a sufficient amount of people
* Add support for Power Resources for Dx states and the necessary hookmpi2013-11-061-5/+11
| | | | | | | | | | | | | | | | for PCI devices. This hook should be called twice, before and after changing the power state of a PCI device. Before setting the device to the new state, the ACPI layer will notify every power resources linked to the device for that state and make sure they are turned "_ON". After changing the state of the device, it will decrement the reference of every power resources linked to that device for the old state and turn them "_OFF" if they are no longer referenced. This fixes the no-USB after resume problem seen on various ThinkPad, problem initialy diagnosed with Alexander Polakov. ok kettenis@, deraadt@
* If ACPI is not compiled in, pci_min_powerstate() has no facts to supportderaadt2013-05-301-2/+2
| | | | | is should return D3. It should return the current power state. ok kettenis mlarkin
* Enforce ca_activate tree-walks over the entire heirarchy for all events,deraadt2013-05-301-3/+2
| | | | | | cleaning up some shutdown-hook related code on the way. (A few drivers related to sparc are still skipped at kettenis' request) ok kettenis mlarkin, tested by many others too
* Add an interface to rebind AGP DMA mappings. To be used by the upcoming KMSkettenis2013-03-171-1/+7
| | | | | support to reload bindings after suspend/resume and to update cachability flags in the address translation table entries.
* Remove excessive sys/cdefs.h inclusionderaadt2012-12-051-3/+1
| | | | ok guenther millert kettenis
* Change the PCI memory extent to cover the whole 64-bit memory spacemikeb2012-10-161-3/+5
| | | | | | | | | but reserve everything above 36 bits so that the erroneous extent allocation will fail but not panic the system. Fixes the notorious IBM x3100 panic where one of the PCI BARs is programmed with an incorrect 64 bit address. Idea and OK kettenis@, tested by Walter Souza, thanks!
* Revamp the sequences for suspend/hibernate -> resume so that the codederaadt2012-10-081-1/+4
| | | | | | | | | | paths are reflexive. It is now possible to fail part-way through a suspend sequence, and recover along the resume code path. Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used after hibernate (and suspend too) to finish the job. Some drivers must be converted at the same time to use this instead of shutdown hooks (the others will follow at a later time) ok kettenis mlarkin
* Set up PCI bus number resource accounting for the main PCI bus hierarchy.kettenis2012-09-192-2/+10
|
* Implement pci_min_powerstate().kettenis2012-09-071-1/+15
|
* Make sure we don't accidentally use ISA or EISA interrupt mappings on PCIkettenis2011-10-291-17/+39
| | | | | | busses. tested by krw@
* I'm sick and tired of people doing misalgned reads and writes to PCI configkettenis2011-10-131-1/+5
| | | | | | space and not noticing because they only test on amd64. So enforce alignment there as well, at least for a little while such that we find those bugs and force people to fix them.
* Cleanup MSI code a bit by moving the code to eanble/disable MSIs intokettenis2011-06-181-48/+39
| | | | | separate functions and install them as route/unroute functions for the MIS pseudo-PIC.
* QEMU pretends to emulate a different prehistoric Intel host bridge.kettenis2011-06-161-5/+7
| | | | From Brad.
* Disable MSIs in pci_intr_disestablish() when appropriate.kettenis2011-06-051-1/+18
|
* Direct MSIs at the appropriate CPU.kettenis2011-06-051-4/+5
|