Ignore:
Timestamp:
2011-12-31T18:19:35Z (12 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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/mm/sun4u/tlb.c

    r852052d rc520034  
    206206        pte_t *t;
    207207
    208         page_table_lock(AS, true);
    209208        t = page_mapping_find(AS, page_16k, true);
    210209        if (t && PTE_EXECUTABLE(t)) {
     
    218217                itsb_pte_copy(t, index);
    219218#endif
    220                 page_table_unlock(AS, true);
    221219        } else {
    222220                /*
     
    224222                 * handler.
    225223                 */
    226                 page_table_unlock(AS, true);
    227224                if (as_page_fault(page_16k, PF_ACCESS_EXEC, istate) ==
    228225                    AS_PF_FAULT) {
     
    250247        size_t index;
    251248        pte_t *t;
     249        as_t *as = AS;
    252250
    253251        page_8k = (uint64_t) tag.vpn << MMU_PAGE_WIDTH;
     
    261259                            "Dereferencing NULL pointer.");
    262260                } else if (page_8k >= end_of_identity) {
    263                         /*
    264                          * The kernel is accessing the I/O space.
    265                          * We still do identity mapping for I/O,
    266                          * but without caching.
    267                          */
    268                         dtlb_insert_mapping(page_8k, KA2PA(page_8k),
    269                             PAGESIZE_8K, false, false);
    270                         return;
     261                        /* Kernel non-identity. */
     262                        as = AS_KERNEL;
     263                } else {
     264                        do_fast_data_access_mmu_miss_fault(istate, tag,
     265                    "Unexpected kernel page fault.");
    271266                }
    272                 do_fast_data_access_mmu_miss_fault(istate, tag, "Unexpected "
    273                     "kernel page fault.");
    274         }
    275 
    276         page_table_lock(AS, true);
    277         t = page_mapping_find(AS, page_16k, true);
     267        }
     268
     269        t = page_mapping_find(as, page_16k, true);
    278270        if (t) {
    279271                /*
     
    286278                dtsb_pte_copy(t, index, true);
    287279#endif
    288                 page_table_unlock(AS, true);
    289280        } else {
    290281                /*
    291282                 * Forward the page fault to the address space page fault
    292283                 * handler.
    293                  */             
    294                 page_table_unlock(AS, true);
     284                 */
    295285                if (as_page_fault(page_16k, PF_ACCESS_READ, istate) ==
    296286                    AS_PF_FAULT) {
     
    314304        size_t index;
    315305        pte_t *t;
     306        as_t *as = AS;
    316307
    317308        page_16k = ALIGN_DOWN((uint64_t) tag.vpn << MMU_PAGE_WIDTH, PAGE_SIZE);
    318309        index = tag.vpn % MMU_PAGES_PER_PAGE;   /* 16K-page emulation */
    319310
    320         page_table_lock(AS, true);
    321         t = page_mapping_find(AS, page_16k, true);
     311        if (tag.context == ASID_KERNEL)
     312                as = AS_KERNEL;
     313
     314        t = page_mapping_find(as, page_16k, true);
    322315        if (t && PTE_WRITABLE(t)) {
    323316                /*
     
    334327                dtsb_pte_copy(t, index, false);
    335328#endif
    336                 page_table_unlock(AS, true);
    337329        } else {
    338330                /*
     
    340332                 * handler.
    341333                 */             
    342                 page_table_unlock(AS, true);
    343334                if (as_page_fault(page_16k, PF_ACCESS_WRITE, istate) ==
    344335                    AS_PF_FAULT) {
Note: See TracChangeset for help on using the changeset viewer.