summaryrefslogtreecommitdiff
path: root/sys/arch/i386/pci
AgeCommit message (Collapse)Author
2021-03-11spellingJonathan Gray
2021-03-06ansiJonathan Gray
2021-02-23timecounting: use C99-style initialization for all timecounter structscheloha
The timecounter struct is large and I think it may change in the future. Changing it later will be easier if we use C99-style initialization for all timecounter structs. It also makes reading the code a bit easier. For reasons I cannot explain, switching to C99-style initialization sometimes changes the hash of the resulting object file, even though the resulting struct should be the same. So there is a binary change here, but only sometimes. No behavior should change in either case. I can't compile-test this everywhere but I have been staring at the diff for days now and I'm relatively confident this will not break compilation. Fingers crossed. ok gnezdo@
2021-01-03Allocate address space for reposting vga devices using km_alloc(9) ratherJonathan Matthew
than uvm_km_valloc(9). ok kettenis@
2020-07-06Add support for timeconting in userland.Paul Irofti
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
2020-06-17add a dumb pci_intr_establish_cpu().David Gwynne
i386 doesnt support msix, and the interrupt code assumes that it only ties stuff to cpu0. this mostly exists so the api exists for multiq drivers to compile against, but fail with when they try to use it. tested with a hacked up vmx(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-03-20Declare pci_intr_map_msix() as static inline instead of using a define.Martin Pieuchot
This makes compiler no longer complain about unused variables. ok kettenis@, patrick@
2020-01-05consistently uppercase pci product definesJonathan Gray
ok mpi@
2020-01-04remove AMD64 strings from pcidevsJonathan Gray
ok mortimer@ mpi@ deraadt@
2019-12-06Retire piixpcib(4).Martin Pieuchot
When PAE came back in 2015 the use of kvm86, required for SpeedStep on such machine, got disabled. So there's no loss of functionality. ok stsp@
2019-01-07Extents code has its own set of flags and does not use malloc's.Alexander Bluhm
The code in pci_init_extents() accidently passed M_NOWAIT which is EX_FAST and does no harm. Replace it with EX_NOWAIT. from Christian Ludwig; OK kettenis@
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-30Use the MI interrupt enable/distable API instead of the MD one on i386 andMark Kettenis
remove the MD API. ok deraadt@
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-12-27Add sizes for free() in the Geode LX Security Block crypto accelerator.Frederic Cambus
OK visa@
2017-09-08If you use sys/param.h, you don't need sys/types.hTheo de Raadt
2017-05-02Switch glxsb(4), VIA padlock and AES-NI drivers over to the new AESMike Belopuhov
2017-02-07Reduce the per-packet allocation costs for crypto operations (cryptop)Patrick Wildt
by pre-allocating two cryptodesc objects and storing them in an array instead of a linked list. If more than two cryptodesc objects are required use mallocarray to fetch them. Adapt the drivers to the new API. This change results in one pool-get per ESP packet instead of three. It also simplifies softraid crypto where more cryptodesc objects are allocated than used. From, with and ok markus@, ok bluhm@ "looks sane" mpi@
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-09-08sizes for free(); ok semarieTheo de Raadt
2015-09-08convert several malloc(9) to mallocarray(9).Sebastien Marie
ok deraadt@ guenther@ "re-wrap the long lines" kettenis@
2015-09-01fairly simple sizes for free()Theo de Raadt
2015-07-17Avoid assigning low addresses to PCI BARs. Some machines don't claim theseMark Kettenis
memory addresses in their BIOS memory map making us believe they are available. However these addresses will never actually be routed to the PCI bus and therefore guaranteed not to work. ok krw@, mlarkin@
2015-07-17Include executable mapping for BIOS32 pages. Fixes a problem where mappingsMike Larkin
done in this region using PAE w/NX caused #PFs (as they lacked the exec permission previously). Also unmap the region when we're finished. No sense in leaving extra executable regions lying around. Fixes non-ACPI uniprocessor i386 machines that have NX/PAE (these would previously panic in pcibiosattach). ok deraadt@
2015-04-12Bring PAE code back to life, in a different form. This diff (via bluhm thenMike Larkin
to deraadt, then myself) brings the PAE pmap on i386 (not touched in any significant way for years) closer to the current non-PAE pmap and allows us to take a big next step toward better i386 W^X in the kernel (similar to what we did a few months ago on amd64). Unlike the original PAE pmap, this diff will not be supporting > 4GB physical memory on i386 - this effort is specifically geared toward providing W^X (via NX) only. There still seems to be a bug removing certain pmap entries when PAE is enabled, so I'm leaving PAE mode disabled for the moment until we can figure out what is going on, but with this diff in the tree hopefully others can help. The pmap functions now operate through function pointers, due to the need to support both non-PAE and PAE forms. My unscientific testing showed less than 0.3% (a third of a percent) slowdown with this approach during a base build. Discussed for months with guenther, kettenis, and deraadt. ok kettenis@, 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-10Convert watchdog(4) devices to use autoconf(9) framework.Mike Belopuhov
ok deraadt, tests on glxpcib and ok mpi
2014-12-09Replace some malloc(n*size,...) calls with mallocarray().Doug Hogan
ok tedu@ 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-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@
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-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-06-29Don't ridiculously assume that sysctl.h will (through a set of extremelyTheo de Raadt
unfortunate circumstances) pull machine/cpufunc.h
2014-05-04format string fixes for bus_addr_t and bus_size_tStefan Fritsch
bus_addr_t and bus_size_t are u_long everywhere ok 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-29It's been a quarter century: we can assume volatile is present with that name.Philip Guenther
ok dlg@ mpi@ 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-28Appease LLVM's integrated assembler.Brad Smith
error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', 'cmpl', or 'cmpq' error: unknown token in expression cmp -> cmpl, %cs:* -> *%cs: ok kettenis@
2013-11-261 << 31 cleanup. Eitan Adler pointed out that there has been aTheo de Raadt
resurrection of the bad idiom in the tree. sufficient review by miod, kettenis, tedu
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-10-29unbreak glxsb(4) by properly allocating it's key schedule;Mike Belopuhov
reduce pctr.h usage while here. ok jsing, deraadt
2013-10-02Format string fixes: Use %l* for paddr_tStefan Fritsch