Changeset c72dc15 in mainline


Ignore:
Timestamp:
2011-12-14T23:57:25Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3b71e84d
Parents:
1b478f6
Message:

When unmapping pages, do not cleanup the first level page tables
in the subtree which corresponds to the kernel non-identity mapping.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/mm/page_pt.c

    r1b478f6 rc72dc15  
    3939#include <mm/page.h>
    4040#include <mm/frame.h>
     41#include <mm/km.h>
    4142#include <mm/as.h>
    4243#include <arch/mm/page.h>
     
    153154       
    154155        /*
    155          * Second, free all empty tables along the way from PTL3 down to PTL0.
    156          *
     156         * Second, free all empty tables along the way from PTL3 down to PTL0
     157         * except those needed for sharing the kernel non-identity mappings.
    157158         */
    158159       
     
    171172                /*
    172173                 * PTL3 is empty.
    173                  * Release the frame and remove PTL3 pointer from preceding table.
    174                  *
    175                  */
    176                 frame_free(KA2PA((uintptr_t) ptl3));
     174                 * Release the frame and remove PTL3 pointer from the parent
     175                 * table.
     176                 */
    177177#if (PTL2_ENTRIES != 0)
    178178                memsetb(&ptl2[PTL2_INDEX(page)], sizeof(pte_t), 0);
     
    180180                memsetb(&ptl1[PTL1_INDEX(page)], sizeof(pte_t), 0);
    181181#else
     182                if (km_is_non_identity(page))
     183                        return;
     184
    182185                memsetb(&ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
    183186#endif
     187                frame_free(KA2PA((uintptr_t) ptl3));
    184188        } else {
    185189                /*
     
    204208                /*
    205209                 * PTL2 is empty.
    206                  * Release the frame and remove PTL2 pointer from preceding table.
    207                  *
    208                  */
    209                 frame_free(KA2PA((uintptr_t) ptl2));
     210                 * Release the frame and remove PTL2 pointer from the parent
     211                 * table.
     212                 */
    210213#if (PTL1_ENTRIES != 0)
    211214                memsetb(&ptl1[PTL1_INDEX(page)], sizeof(pte_t), 0);
    212215#else
     216                if (km_is_non_identity(page))
     217                        return;
     218
    213219                memsetb(&ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
    214220#endif
     221                frame_free(KA2PA((uintptr_t) ptl2));
    215222        } else {
    216223                /*
     
    236243                /*
    237244                 * PTL1 is empty.
    238                  * Release the frame and remove PTL1 pointer from preceding table.
    239                  *
    240                  */
     245                 * Release the frame and remove PTL1 pointer from the parent
     246                 * table.
     247                 */
     248                if (km_is_non_identity(page))
     249                        return;
     250
     251                memsetb(&ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
    241252                frame_free(KA2PA((uintptr_t) ptl1));
    242                 memsetb(&ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
    243253        }
    244254#endif /* PTL1_ENTRIES != 0 */
Note: See TracChangeset for help on using the changeset viewer.