summaryrefslogtreecommitdiff
path: root/sys/src/9/bcm/mmu.c
AgeCommit message (Collapse)Author
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.
2020-12-22kernel: avoid palloc lock during mmurelease()cinap_lenrek
Previously, mmurelease() was always called with palloc spinlock held. This is unneccesary for some mmurelease() implementations as they wont release pages to the palloc pool. This change removes pagechainhead() and pagechaindone() and replaces them with just freepages() call, which aquires the palloc lock internally as needed. freepages() avoids holding the palloc lock while walking the linked list of pages, avoding some lock contention.
2019-12-04bcm: use extended small pages so XN bit can workcinap_lenrek
the change to support no-execute bits broke the original raspberry pi1, as it uses backwards compatible page table format. to use the XN bit, subpage AP bits have to be disabled using the XP bit in CP15 Control Register c1 Bit 23.
2019-08-26kernel: expose no execute bit to portable mmu code as SG_NOEXEC / PTENOEXEC, ↵cinap_lenrek
add PTECACHED bits a portable SG_NOEXEC segment attribute was added to allow non-executable (physical) segments. which will set the PTENOEXEC bits for putmmu(). in the future, this can be used to make non-executable stack / bss segments. the SG_DEVICE attribute was added to distinguish between mmio regions and uncached memory. only matterns on arm64. on arm, theres the issue that PTEUNCACHED would have no bits set when using the hardware bit definitions. this is the reason bcm, kw, teg2 and omap kernels use arteficial PTE constants. on zynq, the XN bit was used as a hack to give PTEUNCACHED a non-zero value and when the bit is clear then cache attributes where added to the pte. to fix this, PTECACHED constant was added. the portable mmu code in fault.c will now explicitely set PTECACHED bits for cached memory and PTEUNCACHED for uncached memory. that way the hardware bit definitions can be used everywhere.
2019-08-21bcm: set XN bits for kernel device mappingscinap_lenrek
2019-07-25bcm, bcm64: add dmaflush() function and make virtio size and virtual address ↵cinap_lenrek
configurable in Soc.virtio and Soc.iosize
2019-05-13bcm, bcm64: preserve memsize across reboots, avoid trashing atags while ↵cinap_lenrek
parsing cmdline we override atag memory on reboot, so preserve the memsize learned from atag as *maxmem plan9 variable. the global memsize variable is not needed anymore. avoid trashing the following atag when zero terminating the cmdline string. zero memory after plan9.ini variables.
2019-04-11kernel: get rid of PTR2UINT() and UINT2PTR() macroscinap_lenrek
2018-10-28bcm: simplify reboot codecinap_lenrek
- synchronize rebootcode installation - handle the 1MB identity map in mmu.c (mmuinit1()) - do not overlap CONFADDR with rebootcode, the non boot processors are parked there. - make REBOOTADDR physical address
2018-10-20bcm: import changes for raspi2/3 from richard millercinap_lenrek
2015-06-15kernel: add pagechaindone() to wakeup processes waiting for memorycinap_lenrek
we keep the details about palloc in page.c, providing pagechaindone() for mmu code to be called after a series of pagechainhead() calls.
2015-02-07kernel: reduce Page structure size by changing Page.cachectl[]cinap_lenrek
there are no kernels currently that do page coloring, so the only use of cachectl[] is flushing the icache (on arm and ppc). on pc64, cachectl consumes 32 bytes in each page resulting in over 200 megabytes of overhead for 32gb of ram with 4K pages. this change removes cachectl[] and adds txtflush ulong that is set to ~0 by pio() to instruct putmmu() to flush the icache.
2014-07-08bcm: apply richards fix for mmukmap (from /n/sources/patch/bcm-mmukmap-bug)cinap_lenrek
2013-01-26add raspberry pi kernel (from sources)cinap_lenrek