Changeset 2057572 in mainline for kernel/arch/sparc64/src/mm/as.c


Ignore:
Timestamp:
2007-03-27T23:40:25Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
399ece9
Parents:
8d37a06
Message:

The Ultimate Solution To Illegal Virtual Aliases.
It is better to avoid them completely than to fight them.
Switch the sparc64 port to 16K pages. The TLBs and TSBs
continue to operate with 8K pages only. Page tables and
other generic parts operate with 16K pages.

Because the MMU doesn't support 16K directly, each 16K
page is emulated by a pair of 8K pages. With 16K pages,
illegal aliases cannot be created in 16K D-cache.

File:
1 edited

Legend:

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

    r8d37a06 r2057572  
    6363#ifdef CONFIG_TSB
    6464        int order = fnzb32(((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) *
    65                 sizeof(tsb_entry_t)) >> FRAME_WIDTH);
     65                sizeof(tsb_entry_t)) >> MMU_FRAME_WIDTH);
    6666        uintptr_t tsb = (uintptr_t) frame_alloc(order, flags | FRAME_KA);
    6767
     
    7272        as->arch.dtsb = (tsb_entry_t *) (tsb + ITSB_ENTRY_COUNT *
    7373                sizeof(tsb_entry_t));
    74         memsetb((uintptr_t) as->arch.itsb, (ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT)
    75                 * sizeof(tsb_entry_t), 0);
     74        memsetb((uintptr_t) as->arch.itsb,
     75            (ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) * sizeof(tsb_entry_t), 0);
    7676#endif
    7777        return 0;
     
    8282#ifdef CONFIG_TSB
    8383        count_t cnt = ((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) *
    84                 sizeof(tsb_entry_t)) >> FRAME_WIDTH;
     84                sizeof(tsb_entry_t)) >> MMU_FRAME_WIDTH;
    8585        frame_free(KA2PA((uintptr_t) as->arch.itsb));
    8686        return cnt;
     
    140140        uintptr_t tsb = (uintptr_t) as->arch.itsb;
    141141               
    142         if (!overlaps(tsb, 8 * PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
     142        if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
    143143                /*
    144144                 * TSBs were allocated from memory not covered
     
    159159        tsb_base.split = 0;
    160160
    161         tsb_base.base = ((uintptr_t) as->arch.itsb) >> PAGE_WIDTH;
     161        tsb_base.base = ((uintptr_t) as->arch.itsb) >> MMU_PAGE_WIDTH;
    162162        itsb_base_write(tsb_base.value);
    163         tsb_base.base = ((uintptr_t) as->arch.dtsb) >> PAGE_WIDTH;
     163        tsb_base.base = ((uintptr_t) as->arch.dtsb) >> MMU_PAGE_WIDTH;
    164164        dtsb_base_write(tsb_base.value);
    165165#endif
     
    190190        uintptr_t tsb = (uintptr_t) as->arch.itsb;
    191191               
    192         if (!overlaps(tsb, 8 * PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
     192        if (!overlaps(tsb, 8 * MMU_PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
    193193                /*
    194194                 * TSBs were allocated from memory not covered
Note: See TracChangeset for help on using the changeset viewer.