• Jeffrey Lee's avatar
    Add initial support for "physical memory pools" · 54872d8c
    Jeffrey Lee authored
      This set of changes adds support for "physical memory pools" (aka PMPs), a new type of dynamic area which allow physical pages to be claimed/allocated without mapping them in to the logical address space. PMPs have full control over which physical pages they use (similar to DAs which request specific physical pages), and also have full control over the logical mapping of their pages (which pages go where, and per-page access/cacheability control).
      Currently the OS makes use of two PMPs: one for the free pool (which now has a logical size of zero - freeing up gigabytes of logical space), and one for the RAM disc (logical size of 1MB, allowing for a physical size limited only by the amount of free memory)
      Implementing these changes has required a number of other changes to be made:
      * The CAM has been expanded from 8 bytes per entry to 16 bytes per entry, in order to allow each RAM page to store information about its PMP association
      * The system heap has been expanded to 32MB in size (from just under 4MB), in order to allow it to be used to store PMP page lists (1 word needed per page, but PMP pages may not always have physical pages assigned to them - so to allow multiple large PMPs to exist we need more than just 1 word per RAM page)
      * The &FA000000-&FBFFFFFF area of fixed kernel workspace has been shuffled around to accomodate the larger CAM, and the system heap is now located just above the RMA.
      * SoftResets code stripped out (unlikely we'll ever want to fix and re-enable it)
      * A couple of FastCDA options are now permanently on
      * Internal page flags shuffled around a bit. PageFlags_Unavailable now publicly exposed so that PMP clients can lock/unlock pages at will.
      * When OS_ChangeDynamicArea is asked to grow or shrink the free pool, it now implicitly converts it into a shrink or grow of application space (which is what would happen anyway). This simplifies the implementation; during a grow, pages (or replacement pages) are always sourced from the free pool, and during a shrink pages are always sent to the free pool.
      File changes:
      - hdr/KernelWS - Extend DANode structure. Describe CAM format. Adjust kernel workspace.
      - hdr/OSRSI6, s/Middle - Add new item to expose the CAM format
      - hdr/Options - Remove SoftResets switch. Add some PMP switches.
      - s/ARM600, s/VMSAv6 - Updated for new CAM format. Note that although the CAM stores PMP information, BangCamUpdate currently doesn't deal with updating that data - it's the caller's responsibility to do so where appropriate.
      - s/ChangeDyn - Lots of changes to implement PMP support, and to cope with the new CAM format.
      - s/HAL - Updated to cope with new CAM format, and lack of logical mapping of free pool.
      - s/MemInfo - Updated to cope with new CAM format. OS_Memory 0 updated to cope with converting PPN to PA for pages which are mapped out. OS_Memory 24 updated to decode the access permissions on a per-page basis for PMPs, and fixed its HWM usage for sparse DAs.
      - s/NewReset - Soft reset code and unused AddCamEntries function removed. Updated to cope with new CAM format, PMP free pool, PMP RAMFS
      - s/AMBControl/allocate - Update comment (RMA hasn't been used for AMBControl nodes for a long time)
      - s/AMBControl/growp, s/AMBControl/memmap, s/AMBControl/shrinkp - Update for new CAM format + PMP free pool
      - s/vdu/vdudriver - Strip out soft reset code.
      Tested on Pandaboard
      This is just a first iteration of the PMP feature, with any luck future changes will improve functionality. This means APIs are subject to change as well.
    Version 5.35, Tagged as 'Kernel-5_35-4_79_2_284'
ARM600 73.7 KB