summaryrefslogtreecommitdiff
path: root/sys/src/9/pc64
AgeCommit message (Collapse)Author
2023-04-19imx8: make etheriwl work on MNT Reform, move it to port/ (thanks cinap); ↵Sigrid Solveig Haflínudóttir
tested with 6205
2023-04-08kernel: Clear secrets on rebootcinap_lenrek
The idea is that when we reboot, we zero out memory written by processes that have the private flag set (such as factotum and keyfs), and also clear the secrmem pool, which contains TLS keys and the state of the random number generator. This is so the newly booted kernel or firmware will not find these secret keys in memory.
2023-01-03devip: actually put igmp in ip sectioncinap_lenrek
2023-01-03devip: add igmp protocol support to all kernelscinap_lenrek
2022-12-11sdmmc: multiple controller supportcinap_lenrek
remove the global sdio struct and add a addmmcio() function for drivers to register their controllers. there is a SDio.aux pointer now where controller drivers can stash a pointer to their private data. SDio.init() also can signal that it wants to be called again for more controllers by returning > 0 (see pc/pmmc.c). this is in preparation for supporting the internal mmc device in the mnt-reform which is hooked up to usdhc1.
2022-12-03usbxhci: split usbxhci in portable and pci / soc specific driverscinap_lenrek
For the reform kernel, we used to have a slightly modified copy of port/usbxhci.c as the controller was implemented in soc specific registers and requires some rocket science initialization. Instead, we want to have a common generic xhci driver (usbxhci) and separate drivers that deal with the specific implementation such as usbxhcipci and usbxhciimx.
2022-09-03pc64: half KSTACK to 8k.cinap_lenrek
2022-08-17kernel: allocate notes in heapcinap_lenrek
de-bloat the proc structure by allocating notes with on the heap instead of embedding them in the proc structure. This saves around 640 bytes per process.
2022-08-17kernel: simplify notify() adding common popnote() functioncinap_lenrek
Handlin notes is common for all architectures except how the note has to be pushed on the user stack. This change adds a popnote() function that returns only the note string or nil if the process should not be notified (no notes or user notes hold off). Popnote() also handles common errors like notify during note handling or missing note handler and will suicide the process in that case.
2025-05-14kernel: get rid of Proc.kstackglenda
The kernel stack is now above the Proc structure, so the explicit kstack pointer can be eliminated.
2022-08-129: compute available kernel pages using sizeof(Proc*)Ori Bernstein
procs come from the dynamic pools, so we don't need to remove the memory used by possible procs from the total available.
2022-08-109/port: allow kiloprocs -- allocate procs lazilyOri Bernstein
Treallocate the small data structures around procs eagerly, but use malloc to allocate the large proc data structures when we need them, which allows us to scale to many more procs. There are still many scalability bottlenecks, so we only crank up the nproc limit by a little bit this time around, and crank it up more as we optimize more.
2022-07-18kernel: consistently add devbridge and netdevmedium to kernel configscinap_lenrek
2022-06-17kernel: add dev dtracy provider.Jacob Moody
2022-06-15skel(3) → skelfs(4)Jacob Moody
The original intention was to put devskel in to the kernel to detach what it provides from devsrv. That is not a good reason, just move it to userspace. auth/box has been changed to exec skelfs instead of relying on '#z'.
2022-06-07kernel: add devskel for pc and pc64Jacob Moody
2022-01-16kernel: make Page.txtflush into an arraycinap_lenrek
To avoid a MAXMACH limit of 32 and make txtflush into an array for the bitmap. Provide portable macros for testing and clearing the bits: needtxtflush(), donetxtflush(). On pc/pc64, define inittxtflush()/settxtflush() as no-op macros, avoiding the storage overhead of the txtflush array alltogether.
2021-12-13devssl, cpu, import, oexportfs: deleteOri Bernstein
SSL is implemented by devssl. It's extremely obsolete by now, and is not used anywhere but cpu, import, and oexportfs. This change strips out the devssl bits, but does not (yet) remove the code from libsec.
2021-11-26kernel: support large 64-bit pci membars, increase pc64 VMAPSIZE to 1TBcinap_lenrek
This makes vmap()/vunmap() take a vlong size argument, and change the type of Pci.mem[].size to vlong as well. Even if vmap() wont support large mappings, it is nice to get the original unruncated value for error checking. pc64 needs a bigger VMAP window, as system76 pangolin puts the framebuffer at a physical address > 512GB.
2021-10-11kernel: move waserror() macro to port/portfns.hcinap_lenrek
2021-07-14pc, pc64: increase confmem slots to 64cinap_lenrek
Lenovo Thinkpad P17 Gen1 Professional Mobile Workstation comes up with around 36 separate memory ranges. ridiculous!
2021-07-11virtio: add non-legacy virtio 1.0 drivers for disk and ethernetcinap_lenrek
The new interface uses pci capability structures to locate the registers in a rather fine granular way making it more complicated as they can be located anywhere in any pci bar at any offset. As far as i can see, qemu (6.0.50) never uses i/o bars in non-legacy mode, so only mmio is implemented for now. The previous virtio drivers implemented the legacy interface only which uses i/o ports for all register accesses. This is still the preferred method (and also qemu default) as it is easier to emulate and most likely faster. However, some vps providers like vultr force the legacy interface to disabled with qemu -device option "disable-legacy=on" resulting on a system without a disk and ethernet.
2021-05-12pc64: avoid getcr3() in mmuflushtlb()cinap_lenrek
it turns out that calculating physical address of pml4 is faster than reading the machine register, so pass it explicitely.
2021-04-25kernel: clean up Mach structurecinap_lenrek
Remove unused fields and factor common fields into a new PMach struct in port/portdat.h. The fields machno, splpc and proc are not moved to PMach as they are part of the known offsets from assembly (l.s).
2021-04-02kernel: get rid of physical page bank array and use conf.mem[] insteadcinap_lenrek
We can take advantage of the fact that xinit() allocates kernel memory from conf.mem[] banks always at the beginning of a bank, so the separate palloc.mem[] array can be eleminated as we can calculate the amount of non-kernel memory like: upages = cm->npage - (PGROUND(cm->klimit - cm->kbase)/BY2PG) for the number of reserved kernel pages, we provide the new function: ulong nkpages(Confmem*) This eleminates the error case of running out of slots in the array and avoids wasting memory in ports that have simple memory configurations (compared to pc/pc64).
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-21kernel: update procsave() comment, we'r not holding up->rlock anymorecinap_lenrek
2020-12-20kernel: handle tos and per process pcycle counters in port/cinap_lenrek
we might as well handle the per process cycle counter in the portable part instead of duplicating the code in every arch and have inconsistent implementations. we now have a portable kenter() and kexit() function, that is ment to be used in trap/syscall from user, which updates the counters. some kernels missed initializing Mach.cyclefreq.
2020-12-17ether2114x: vetting the driver for pc64cinap_lenrek
the tulip driver is used in microsofts hypver-v as the legacy ethernet adapter for pxe booting. to make the driver work on pc64, we need to store the Block* pointers in a separate array instead of stuffing them into buffer address 2 of the hardware descriptor. also, enable the driver in the pc64 kernel.
2020-12-06pc64: assign fpsave/fprestore only once in fpuinit()cinap_lenrek
2020-12-06pc64: AMD64 mandates SSE support, remove the check in fpuinit()cinap_lenrek
2020-12-06pc, pc64: move all fpu specific code from main.c to fpu.ccinap_lenrek
2020-12-06amd64: FP: back to static size for allocation and copyingSigrid
2020-12-06amd64: FP: always use enough to fit AVX state and align to 64 bytesSigrid
2020-12-06amd64, vmx: support avx/avx2 for host/guest; use *noavx= in plan9.ini to disableSigrid
2020-12-05pc, pc64: allocate dma bounce buffer right after xinit()cinap_lenrek
2020-12-05pc, pc64: exclude memory regions with unusual MTRR cache attributescinap_lenrek
Use the MTRR registers to exclude memory ranges that do not have the expected cache attributes: RAM -> writeback UMB -> uncached UPA -> uncached
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-22pc, pc64: move common irq handling code out of trap.ccinap_lenrek
Move the common irq handling code out of trap.c into pc/irq.c so that it can be shared between 386 and amd64 ports.
2020-11-21pc, pc64: fix grub multibootcinap_lenrek
It appears that our IDT overlaps with the data structures passed from grub in multiboot load. So defer setup of the interrupt table after the multiboot parameters have been processed.
2020-11-21pc, pc64: implement disabling of msi interruptscinap_lenrek
2020-11-21pc, pc64: disable all pci devices for /dev/rebootcinap_lenrek
Make sure all pci busmaster activity is disabled, including MSI/MSI-X interrupts, before switching control to the new kernel.
2020-11-17pc, pc64: load idt early in trapinit0()cinap_lenrek
loading the interrupt vector table early allows us to handle traps during bootup before mmuinit() which gives better diagnostics for debugging. we also can handle general protection fault on rdmsr() and wrmsr() which helps during cpuidentify() and archinit() when probing for cpu features.
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-07-16pc64: disable interrupts in mmuwalk() for checkmmu()cinap_lenrek
we have to disable interrupts during mmuwalk() of user pages as we can get preempted during mmu walk and the original m->pml4 might become one of a different process.
2020-06-06devpccard: use 64-bit physical addressescinap_lenrek
2020-06-06pc, pc64: use 64-bit physical addresses for ISAConf.portcinap_lenrek
2020-06-06pc, pc64: use 64-bit physical addresses for vmap() and upaalloc()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.