summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/pci
AgeCommit message (Collapse)Author
2024-11-05The first field of struct cfdriver is a pointer. Put NULL rather than 0 here.Miod Vallat
2024-10-10allow MSI with the QEMU default pc-i440fx machineJonathan Gray
This makes it possible to use MSI for virtual functions of Intel network devices without having to specify the q35 machine. QEMU is detected by testing for the Qumranet pci subsystem vendor id, suggested by sf@. MSI previously wasn't enabled as i440fx models a machine from 1996 with ACPI 1.0, and MSI is only enabled for ACPI >= 2.0. Initial patch from Yuichiro NAITO. ok yasuoka@ sf@
2024-07-02remove oga's copyright notice, none of those changes remainJonathan Gray
2024-07-02remove unused agp_flush_cache_range()Jonathan Gray
2024-07-02remove unused agp_map functionsJonathan Gray
last use (in inteldrm) was removed in March
2024-05-13Implement hardware masking for MSI and MSI-X on amd64. Note that maskingMark Kettenis
MSIs can only be done for PCI devices that implement per-vector masking, which a lot of hardware doesn't implement. ok mlarkin@
2024-05-13remove prototypes with no matching functionJonathan Gray
ok mpi@
2024-02-02Fix vector number check.Mark Kettenis
ok kevlo@, patrick@
2024-01-19Implement Multiple Message MSI support on amd64. This is experimental codeMark Kettenis
to assist qwx(4) development. We may remove this code again at some point in the future. Multiple Message MSI has some serious design flaws, especially when combined with the APIC interrupt controller architecture. It was superseded by MSI-X. Unfortunately qwx(4) does not implement MSI-X. ok stsp@, deraadt@
2022-02-21Constify struct cfattach.Martin Pieuchot
2021-03-11spellingJonathan Gray
2021-01-03Allocate address space for reposting vga devices using km_alloc(9) ratherJonathan Matthew
than uvm_km_valloc(9). ok kettenis@
2020-10-27Adding IOMMU support for AMD Vi and Intel VTD (disabled)Jordan Hargrave
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@ : ----------------------------------------------------------------------
2020-09-26Stop printing the extents for release.Mark Kettenis
ok deraadt@
2020-06-17pci_intr_establish_cpu() for establishing an interrupt no a specific cpu.David Gwynne
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)
2020-05-29dev/rndvar.h no longer has statistical interfaces (removed during variousTheo de Raadt
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.
2020-05-14Bring back the acpi(4) changes. This time around only use the ACPI _CRSMark Kettenis
information on ACPI 5.0 and later. ok krw@, patrick@
2020-01-04remove AMD64 strings from pcidevsJonathan Gray
ok mortimer@ mpi@ deraadt@
2019-09-07Revert acpipci(4) changes. Too many systems are broken. We'll try againMark Kettenis
after 6.6 as been released. The acpireg.h change stays behind.
2019-08-28Use ACPI information to attach PCI busses like we do on arm64. There are aMark Kettenis
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@
2019-06-25Implement suspend/resume support for MSI-X interrupts. Loosely based onMark Kettenis
an earlier diff from sf@. ok jmatthew@, also ok mlarkin@, sf@ for a slightly different earlier version
2019-05-30Use two 32-bit writes instead of a single 64-bit write to write theMark Kettenis
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@
2018-10-26Add acpipci(4) on amd64. For now this only calls the PCI-specific _OSCMark Kettenis
method to let the ACPI implementation know what features we support.
2018-08-19Add support for multiple PCI segments. Only really implemented for arm64Mark Kettenis
for now as amd64/i386 firmware still caters for legacy OSes that only support a single PCI segment. ok patrick@
2018-07-04Properly pass around the PCI "chipset tag" in acpi(4) and refactorMark Kettenis
acpimcfg(4) to call an MD initialization functions that sets up a tag for PCI ECAM. ok guenther@, mlarkin@, krw@
2018-04-28replace add_*_randomness with enqueue_randomness()Jasper Lievisse Adriaanse
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@
2017-10-14reduce the amount of includes in arch/amd64Jonathan Gray
ok mpi@ deraadt@
2017-09-08If you use sys/param.h, you don't need sys/types.hTheo de Raadt
2016-06-02Fix two issues in the MSI-X code. First, actually read the MSI-X capabilityMark Kettenis
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.
2016-05-14Fix typo; M_NOWAIT should be EX_NOWAIT. Fortunately this was harmless.Mark Kettenis
2016-05-04Initial support for MSI-X. Only supported on amd64 for now. I have diffs toMark Kettenis
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@
2015-08-28fairly simple sizes for free(); ok teduTheo de Raadt
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-01-24Add bus_dmamem_alloc_range(9) to allow drivers to allocate DMA'able memoryMark Kettenis
within a range that is more (or less) restrictive than the default range. ok deraadt@, stsp@
2014-12-16Temporarily expand the pci memory range to suit Dell 13G servers.Jonathan Matthew
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@
2014-11-16Replace a plethora of historical protection options with justTheo de Raadt
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
2014-09-20On i386, agp_map_subregion might sleep, which is not allowed in some ofMark Kettenis
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.
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-04-19Don't panic if we're trying to disestablish an MSI but the hardware is gone.Mark Kettenis
tested by & ok mlarkin@
2014-04-08No need for <uvm/uvm_page.h>Martin Pieuchot
2014-04-01More <uvm/uvm.h> -> <uvm/uvm_extern.h> cleaning.Martin Pieuchot
ok kettenis@, deraadt@
2014-03-26No need to include <sys/lock.h> when only <sys/rwlock.h> is needed,Martin Pieuchot
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.
2013-12-09Remove MD intagp(4) code that is unused now that inteldrm(4) manages the GTTMark Kettenis
all by itself.
2013-12-07Remove the agp-specific bus_dma code. It is no longer used now thatMark Kettenis
inteldrm(4) manages the GTT by itself. ok miod@
2013-12-06Add a DVACT_WAKEUP op to the *_activate() API. This is called after theTheo de Raadt
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
2013-11-06Add support for Power Resources for Dx states and the necessary hookMartin Pieuchot
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@
2013-05-30If ACPI is not compiled in, pci_min_powerstate() has no facts to supportTheo de Raadt
is should return D3. It should return the current power state. ok kettenis mlarkin
2013-05-30Enforce ca_activate tree-walks over the entire heirarchy for all events,Theo de Raadt
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
2013-03-17Add an interface to rebind AGP DMA mappings. To be used by the upcoming KMSMark Kettenis
support to reload bindings after suspend/resume and to update cachability flags in the address translation table entries.
2012-12-05Remove excessive sys/cdefs.h inclusionTheo de Raadt
ok guenther millert kettenis