summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/devarch.c
AgeCommit message (Collapse)Author
2022-09-22devarch: add name for VIA C7 EdenArne Meyer
2021-02-20pc/devarch: use m->cpumhz instead of recalculatin itcinap_lenrek
2021-01-17pc, pc64: add minimal HPET driver to measure LAPIC and TSC frequenciescinap_lenrek
This adds the new function pointer PCArch.clockinit(), which is a timer dependent initialization routine. It also takes over the job of guesscpuhz(). This way, the architecture ident code can switch between different timers (i8253, HPET and XEN timer).
2020-12-08pc, pc64: cleanup cpuidentify() and some commentscinap_lenrek
2020-12-08pc, pc64: add *nomtrr= kernel parametercinap_lenrek
2020-12-06amd64, vmx: support avx/avx2 for host/guest; use *noavx= in plan9.ini to disableSigrid
2020-11-29pc, pc64, xen: rewrite interrupt handling codecinap_lenrek
This implements proper intrdisable() support for all interrupt controllers. For enable, (*arch->intrassign)(Vctl*) fills in the Vctl.enable and Vctl.disable pointers with the appropriate routines and returns the assigned vector number. Once the Vctl struct has been linked to its vector chain, Vctl.enable(Vctl*, shared) gets called with a flag if the vector has been already enabled (shared). This order is important here as enabling the interrupt on the controller before we have linked the chain can cause spurious interrupts, expecially on mp system where the interrupt can target a different cpu than the caller of intrenable(). The intrdisable() case is the other way around. We first disable the interrupt on the controller and after that unlink the Vctl from the chain. On a multiprocessor, the xfree() of the Vctl struct is delayed to avoid freeing it while it is still in use by another cpu. The xen port now also uses pc/irq.c which has been made generic enougth to handle xen's irq scheme. Also, archgeneric is now a separate file to avoid pulling in dependencies from the 8259 interrupt controller code.
2020-11-03pc, pc64: allocate i/o port space for unassigned pci bars, move ioalloc() to ↵cinap_lenrek
port/iomap.c With some newer UEFI firmware, not all pci bars get programmed and we have to assign them ourselfs. This was already done for memory bars. This change adds the same for i/o port space, by providing a ioreservewin() function which can be used to allocate port space within the parent pci-pci bridge window. Also, the pci code now allocates the pci config space i/o ports 0xCF8/0xCFC so userspace needs to use devpnp to access pci config space now. (see latest realemu change). Also, this moves the ioalloc()/iofree() code out of devarch into port/iomap.c as it can be shared with the ppc mtx kernel.
2020-09-13kernel: massive pci code rewritecinap_lenrek
The new pci code is moved to port/pci.[hc] and shared by all ports. Each port has its own PCI controller implementation, providing the pcicfgrw*() functions for low level pci config space access. The locking for pcicfgrw*() is now done by the caller (only port/pci.c). Device drivers now need to include "../port/pci.h" in addition to "io.h". The new code now checks bridge windows and membars, while enumerating the bus, giving the pc driver a chance to re-assign them. This is needed because some UEFI implementations fail to assign the bars for some devices, so we need to do it outselfs. (See pcireservemem()). While working on this, it was discovered that the pci code assimed the smallest I/O bar size is 16 (pcibarsize()), which is wrong. I/O bars can be as small as 4 bytes. Bit 1 in an I/O bar is also reserved and should be masked off, making the port mask: port = bar & ~3;
2020-06-06pc, pc64: use 64-bit physical addresses for ISAConf.portcinap_lenrek
2020-05-31pc, xen: make PAT support optional (for xen)cinap_lenrek
2020-05-22pc, pc64: do page attribute table (PAT) init early in cpuidentify()cinap_lenrek
the page attribute table was initialized in mmuinit(), which is too late for bootscreen(). So now we check for PAT support and insert the write-combine entry early in cpuidentify(). this might have been the cause of some slow EFI framebuffers on machines with overlapping or insufficient MTRR entries.
2019-08-27pc64: implement NX bit discovery, map kernel mappings no-executecinap_lenrek
2019-04-13pc: devarch: recognize AMD Ryzen modelmischief
2018-09-09devarch: reading msr 0xffffffffcinap_lenrek
2018-09-09devarch: restrict i/o port access to 64K, disallow msr 32-bit wrap arround ↵cinap_lenrek
(thanks aiju)
2018-09-08devarch: fix /dev/msr (thanks joe9, aiju)cinap_lenrek
the end condition port < offset+n could never become false when offset truncated to 32 bit signed port is negative. change the condition variables to unsigned int. msr's are not byte addressible, so advance reads by one instead of 8.
2018-07-11pc: fix ugly and partially broken switch() statementaiju
2018-07-11pc kernel: get rid of ugly and partially broken cpuid macrosaiju
2017-09-27kernel: don't tokenize inplace in isaconfig() to make /dev/reboot workcinap_lenrek
2017-06-12kernel: add support for hardware watchpointsaiju
2017-03-01pc, pc64: bump Qmax in devarchmischief
my x301 and t420 run out of archfiles with *acpi= while trying to add hdacmd from audiohda.
2017-01-22pc/pc64: get rid of timerset(0) case, was used with "i8253set off" ctlcinap_lenrek
2016-08-27kernel: switch to fast portable chacha based seed-once random number generatorcinap_lenrek
2016-01-11pc/pc64: bring up ap's one after another, use idlehands() while waiting for ↵cinap_lenrek
thunderbirdsarego when testing in qemu, launching each ap became slower and slower because all the ap's where spinning in syncclock() waiting for cpu0 to update its mach0->tscticks, which happens only much later after all cpu's have been started up. now we wait for each cpu to do its timer callibration and manually update our tscticks while we wait and each cpu will not spin but halt while waiting for active.thunderbirdsarego. this reduces the system load and noise for timer callibration and makes the mp startup linear with regard to the number of cores.
2015-07-16pc: check Sse (bit 25) in cpuiddx before enabling fxsr in cr4 (fixes crash ↵cinap_lenrek
on the pentium II)
2014-12-22pc, pc64: include PCArch.id in #P/archctl simplify #P/ioalloc read handlercinap_lenrek
2014-12-19pc, pc64: untangle acpireset() from mpshutdown()cinap_lenrek
mpshutdown() used to call acpireset() making it impossible to build a kernel without archacpi. now, mpshutdown() is a helper function that only shuts down the application processors that gets used from mpreset() and acpireset(). the generic machine reset code in exported by devarch's archreset() function that is called by mpreset() and from acpireset() as a fallback. so the code duplication that was in mpshutdown() is avoided.
2014-12-17pc, pc64: cleanup devarchcinap_lenrek
- shorten cpuidprnt so it doesnt have to break line - addarchfile: complain when running out of entries - fix range check in rmemrw() (harmless) - use nil instead of 0 for pointers
2014-12-13pc, pc64: untangle embedded controller (ec) dependency from devarchcinap_lenrek
2014-11-10pc, pc64: provide access to embedded controller with #P/ec filecinap_lenrek
2014-10-21pc, pc64: make mtrr() callable from interrupt context and before mpinitcinap_lenrek
to make it possible to mark the bootscreen framebuffer as write combining in early initialization, mtrr() is changed not not to error() but to return an error string. as bootscreen() is used before multiprocessor initialization, we have to synchronize the mtrr's for every processor as it comes online. for this, a new mtrrsync() function is provided that is called from cpuidentify() if mtrr support is indicated. the boot processor runs mtrrsync() which snarfs the registers. later, mtrrsync() is run again from the application processors which apply the values from the boot processor. checkmtrr() from mp.c was removed as its task is also done by mtrrsync() now.
2014-07-09pc, pc64: initial machine check architecture supportcinap_lenrek
2014-05-26pc64: fix ulongs for address of devarchs realmodemem filecinap_lenrek
2014-05-11pc, pc64: handle sse simd exceptionscinap_lenrek
2014-02-03pc/pc64: move common code to pc/devarch.ccinap_lenrek
2014-02-01pc kernel: split mpstartap() and squidboy into separate file... stuff for amd64cinap_lenrek
2013-05-22sse kernel support (sources)jpathy
2012-10-01devproc buffer overflow, strncpycinap_lenrek
in devproc status read handler the p->status, p->text and p->user could overflow the local statbuf buffer as they where copied into it with code like: memmove(statbuf+someoff, p->text, strlen(p->text)). now using readstr() which will truncate if the string is too long. make strncpy() usage consistent, make sure results are always null terminated.
2012-08-31rdmsr/wrmsr become tryrdmsr/trywrmsr, we can should check for trapcinap_lenrek
2012-08-17pckernel: use constants instead of hardcoding cpuid bits in various placescinap_lenrek
2012-05-04kernel: use monitor/mwait instruction on pc multiprocessor for idlehandscinap_lenrek
2012-05-01cardbus io reservationcinap_lenrek
2011-12-12kernel: fix inproper use of malloc/smalloccinap_lenrek
2011-11-05remove realmode and e820 code from kernelcinap_lenrek
2011-07-19reading from/writing to non-existant MSRs via /dev/msr no longer crashes the ↵aiju
system
2011-04-16moved /dev/mordor to devconsaiju
2011-04-15added /dev/mordoraiju
2011-04-15added geode driveraiju
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen