Changeset c520034 in mainline for kernel/arch/mips64/src/mm


Ignore:
Timestamp:
2011-12-31T18:19:35Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
295f658, 77c2b02, 96cd5b4
Parents:
852052d (diff), 22f0561 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Support for kernel non-identity mappings, phase I.

  • identity/non-identity kernel memory split on all architectures
  • low/high physical memory split on all architectures
  • frame allocator understands low/high memory
  • high physical memory currently unused (Phase II)
  • more compact frame_t
  • zone conf frames, pte_t, kernel stacks allocated from low memory
  • lockless TLB-miss handlers everywhere (newly sparc64, ia64)
  • preallocate PTL1 page tables for non-identity and prevent their deallocation
  • hw_map() unification
  • new resource allocator used for allocating kernel virtual addresses

Breakage:

  • sparc64/sun4v creates too large kernel identity; not fixed because of lack of testing hw
  • ppc32's tlb_refill() seems wrong as it creates too large kernel identity, but appears unused and the architecture works normally

Not implemented yet (phase II):

  • allow high memory to be used for common kernel allocations
Location:
kernel/arch/mips64/src/mm
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips64/src/mm/frame.c

    r852052d rc520034  
    123123}
    124124
    125 static void frame_add_region(pfn_t start_frame, pfn_t end_frame)
    126 {
    127         if (end_frame > start_frame) {
    128                 /* Convert 1M frames to 16K frames */
    129                 pfn_t first = ADDR2PFN(start_frame << ZERO_PAGE_WIDTH);
    130                 pfn_t count = ADDR2PFN((end_frame - start_frame) << ZERO_PAGE_WIDTH);
    131                
     125static void frame_add_region(pfn_t start_frame, pfn_t end_frame, bool low)
     126{
     127        if (end_frame <= start_frame)
     128                return;
     129
     130        uintptr_t base = start_frame << ZERO_PAGE_WIDTH;
     131        size_t size = (end_frame - start_frame) << ZERO_PAGE_WIDTH;
     132
     133        if (!frame_adjust_zone_bounds(low, &base, &size))
     134                return;
     135
     136        pfn_t first = ADDR2PFN(base);
     137        size_t count = SIZE2FRAMES(size);
     138        pfn_t conf_frame;
     139
     140        if (low) {
    132141                /* Interrupt vector frame is blacklisted */
    133                 pfn_t conf_frame;
    134142                if (first == 0)
    135143                        conf_frame = 1;
    136144                else
    137145                        conf_frame = first;
     146                zone_create(first, count, conf_frame,
     147                    ZONE_AVAILABLE | ZONE_LOWMEM);
     148        } else {
     149                conf_frame = zone_external_conf_alloc(count);
     150                zone_create(first, count, conf_frame,
     151                    ZONE_AVAILABLE | ZONE_HIGHMEM);
     152        }
    138153               
    139                 zone_create(first, count, conf_frame, 0);
    140154               
    141                 if (phys_regions_count < MAX_REGIONS) {
    142                         phys_regions[phys_regions_count].start = first;
    143                         phys_regions[phys_regions_count].count = count;
    144                         phys_regions_count++;
    145                 }
     155        if (phys_regions_count < MAX_REGIONS) {
     156                phys_regions[phys_regions_count].start = first;
     157                phys_regions[phys_regions_count].count = count;
     158                phys_regions_count++;
    146159        }
    147160}
     
    156169 *
    157170 */
    158 void frame_arch_init(void)
     171void frame_low_arch_init(void)
    159172{
    160173        ipl_t ipl = interrupts_disable();
     
    207220               
    208221                if (!avail) {
    209                         frame_add_region(start_frame, frame);
     222                        frame_add_region(start_frame, frame, true);
    210223                        start_frame = frame + 1;
    211224                        avail = true;
     
    213226        }
    214227       
    215         frame_add_region(start_frame, frame);
     228        frame_add_region(start_frame, frame, true);
    216229       
    217230        /* Blacklist interrupt vector frame */
     
    229242}
    230243
     244void frame_high_arch_init(void)
     245{
     246}
     247
    231248void physmem_print(void)
    232249{
  • kernel/arch/mips64/src/mm/page.c

    r852052d rc520034  
    4343}
    4444
    45 /** Map device into kernel space
    46  * - on mips, all devices are already mapped into kernel space,
    47  *   translate the physical address to uncached area
    48  */
    49 uintptr_t hw_map(uintptr_t physaddr, size_t size)
    50 {
    51         return physaddr + 0xffffffffa0000000;
    52 }
    53 
    5445/** @}
    5546 */
Note: See TracChangeset for help on using the changeset viewer.