Changeset 2057572 in mainline for kernel/genarch/src/mm/page_ht.c


Ignore:
Timestamp:
2007-03-27T23:40:25Z (17 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/genarch/src/mm/page_ht.c

    r8d37a06 r2057572  
    5656static void remove_callback(link_t *item);
    5757
    58 static void ht_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags);
     58static void ht_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame,
     59    int flags);
    5960static void ht_mapping_remove(as_t *as, uintptr_t page);
    6061static pte_t *ht_mapping_find(as_t *as, uintptr_t page);
     
    104105         * hash index.
    105106         */
    106         index = ((page >> PAGE_WIDTH) & (PAGE_HT_ENTRIES-1));
     107        index = ((page >> PAGE_WIDTH) & (PAGE_HT_ENTRIES - 1));
    107108       
    108109        /*
     
    111112         * hash index.
    112113         */
    113         index |= ((unative_t) as) & (PAGE_HT_ENTRIES-1);
     114        index |= ((unative_t) as) & (PAGE_HT_ENTRIES - 1);
    114115       
    115116        return index;
     
    137138
    138139        if (keys == PAGE_HT_KEYS) {
    139                 return (key[KEY_AS] == (uintptr_t) t->as) && (key[KEY_PAGE] == t->page);
     140                return (key[KEY_AS] == (uintptr_t) t->as) &&
     141                    (key[KEY_PAGE] == t->page);
    140142        } else {
    141143                return (key[KEY_AS] == (uintptr_t) t->as);
     
    176178{
    177179        pte_t *t;
    178         unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
     180        unative_t key[2] = {
     181                (uintptr_t) as,
     182                page = ALIGN_DOWN(page, PAGE_SIZE)
     183        };
    179184       
    180185        if (!hash_table_find(&page_ht, key)) {
     
    210215void ht_mapping_remove(as_t *as, uintptr_t page)
    211216{
    212         unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
     217        unative_t key[2] = {
     218                (uintptr_t) as,
     219                page = ALIGN_DOWN(page, PAGE_SIZE)
     220        };
    213221       
    214222        /*
     
    235243        link_t *hlp;
    236244        pte_t *t = NULL;
    237         unative_t key[2] = { (uintptr_t) as, page = ALIGN_DOWN(page, PAGE_SIZE) };
     245        unative_t key[2] = {
     246                (uintptr_t) as,
     247                page = ALIGN_DOWN(page, PAGE_SIZE)
     248        };
    238249       
    239250        hlp = hash_table_find(&page_ht, key);
Note: See TracChangeset for help on using the changeset viewer.