diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2005-09-25 19:46:57 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-09-25 19:46:57 -0400 |
commit | 56425306517ef28a9b480161cdb96d182172bc1d (patch) | |
tree | 204cfbef0e5d86954f87b6b40d79d57f8157e5ea /include/asm-sparc64/pgtable.h | |
parent | 52f26deb7c67d5f34910660200b925c1a2b8df8c (diff) |
[SPARC64]: Add CONFIG_DEBUG_PAGEALLOC support.
The trick is that we do the kernel linear mapping TLB miss starting
with an instruction sequence like this:
ba,pt %xcc, kvmap_load
xor %g2, %g4, %g5
succeeded by an instruction sequence which performs a full page table
walk starting at swapper_pg_dir.
We first take over the trap table from the firmware. Then, using this
constant PTE generation for the linear mapping area above, we build
the kernel page tables for the linear mapping.
After this is setup, we patch that branch above into a "nop", which
will cause TLB misses to fall through to the full page table walk.
With this, the page unmapping for CONFIG_DEBUG_PAGEALLOC is trivial.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64/pgtable.h')
-rw-r--r-- | include/asm-sparc64/pgtable.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index a297f6144f0f..43cbb089cde2 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -60,13 +60,13 @@ | |||
60 | * table can map | 60 | * table can map |
61 | */ | 61 | */ |
62 | #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3)) | 62 | #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3)) |
63 | #define PMD_SIZE (1UL << PMD_SHIFT) | 63 | #define PMD_SIZE (_AC(1,UL) << PMD_SHIFT) |
64 | #define PMD_MASK (~(PMD_SIZE-1)) | 64 | #define PMD_MASK (~(PMD_SIZE-1)) |
65 | #define PMD_BITS (PAGE_SHIFT - 2) | 65 | #define PMD_BITS (PAGE_SHIFT - 2) |
66 | 66 | ||
67 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ | 67 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ |
68 | #define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3) + PMD_BITS) | 68 | #define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3) + PMD_BITS) |
69 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | 69 | #define PGDIR_SIZE (_AC(1,UL) << PGDIR_SHIFT) |
70 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | 70 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) |
71 | #define PGDIR_BITS (PAGE_SHIFT - 2) | 71 | #define PGDIR_BITS (PAGE_SHIFT - 2) |
72 | 72 | ||
@@ -336,7 +336,8 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *p | |||
336 | #define pte_clear(mm,addr,ptep) \ | 336 | #define pte_clear(mm,addr,ptep) \ |
337 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) | 337 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) |
338 | 338 | ||
339 | extern pgd_t swapper_pg_dir[1]; | 339 | extern pgd_t swapper_pg_dir[2048]; |
340 | extern pmd_t swapper_low_pmd_dir[2048]; | ||
340 | 341 | ||
341 | /* These do nothing with the way I have things setup. */ | 342 | /* These do nothing with the way I have things setup. */ |
342 | #define mmu_lockarea(vaddr, len) (vaddr) | 343 | #define mmu_lockarea(vaddr, len) (vaddr) |