4level support for sh
Subsystems (2)
PATCH 13/17 4level support for sh
4level support for sh
Converted, but doesn't compile for other reasons
arch/sh/mm/cache-sh4.c +2 -2
@@ -301,7 +301,7 @@ void flush_cache_range(struct vm_area_stunsigned long phys;unsigned long d =0 ; - dir =pgd_offset (vma->vm_mm, p); + dir =pml4_pgd_offset (pml4_offset (vma->vm_mm, p), p); pmd =pmd_offset (dir, p); do {
@@ -354,7 +354,7 @@ void flush_cache_page(struct vm_area_strpte_t entry;unsigned long phys; - dir =pgd_offset (vma->vm_mm, address); + dir =pml4_pgd_offset (pml4_offset (vma->vm_mm, address), address); pmd =pmd_offset (dir, address);if (pmd_none (*pmd) ||pmd_bad (*pmd))return ;
arch/sh/mm/fault.c +2 -2
@@ -209,13 +209,13 @@ asmlinkage int __do_page_fault(struct pt#endif if (address >=P3SEG && address < addrmax) - dir =pgd_offset_k (address); + dir =pml4_pgd_offset (pml4_offset_k (address), address);else if (address >=TASK_SIZE )return 1 ;else if (!current->mm)return 1 ;else - dir =pgd_offset (current->mm, address); + dir =pml4_pgd_offset (pml4_offset (current->mm,address),address); pmd =pmd_offset (dir, address);if (pmd_none (*pmd))
arch/sh/mm/hugetlbpage.c +2 -2
@@ -30,7 +30,7 @@ static pte_t *huge_pte_alloc(struct mm_spmd_t *pmd;pte_t *pte =NULL ; - pgd =pgd_offset (mm, addr); + pgd =pml4_pgd_offset (pml4_offset (mm, addr), addr);if (pgd) { pmd =pmd_alloc (mm, pgd, addr);if (pmd)
@@ -45,7 +45,7 @@ static pte_t *huge_pte_offset(struct mm_pmd_t *pmd;pte_t *pte =NULL ; - pgd =pgd_offset (mm, addr); + pgd =pml4_pgd_offset (pml4_offset (mm, addr), addr);if (pgd) { pmd =pmd_offset (pgd, addr);if (pmd)
arch/sh/mm/init.c +11 -0
@@ -313,3 +313,14 @@ void free_initrd_mem(unsigned long start }#endif + +pgd_t *__pgd_alloc (struct mm_struct *mm,pml4_t *dummy,unsigned long addr) +{ +unsigned int pgd_size = (USER_PTRS_PER_PGD *sizeof (pgd_t)); +pgd_t *pgd = (pgd_t *)kmalloc (pgd_size,GFP_KERNEL ); + +if (pgd) +memset (pgd,0 , pgd_size); + +return pgd; +}
arch/sh/mm/ioremap.c +1 -1
@@ -75,7 +75,7 @@ int remap_area_pages(unsigned long addreunsigned long end = address + size; phys_addr -= address; - dir =pgd_offset_k (address); + dir =pml4_pgd_offset (pml4_offset_k (address), address);flush_cache_all ();if (address >= end)BUG ();
arch/sh/mm/pg-sh4.c +2 -2
@@ -42,7 +42,7 @@ void clear_user_page(void *to, unsigned _PAGE_HW_SHARED | _PAGE_FLAGS_HARD);unsigned long phys_addr =PHYSADDR (to);unsigned long p3_addr =P3SEG + (address &CACHE_ALIAS ); -pgd_t *dir =pgd_offset_k (p3_addr); +pgd_t *dir =pml4_pgd_offset (pml4_offset_k (p3_addr), p3_addr);pmd_t *pmd =pmd_offset (dir, p3_addr);pte_t *pte =pte_offset_kernel (pmd, p3_addr);pte_t entry;
@@ -81,7 +81,7 @@ void copy_user_page(void *to, void *from _PAGE_HW_SHARED | _PAGE_FLAGS_HARD);unsigned long phys_addr =PHYSADDR (to);unsigned long p3_addr =P3SEG + (address &CACHE_ALIAS ); -pgd_t *dir =pgd_offset_k (p3_addr); +pgd_t *dir =pml4_pgd_offset (pml4_offset_k (p3_addr), p3_addr);pmd_t *pmd =pmd_offset (dir, p3_addr);pte_t *pte =pte_offset_kernel (pmd, p3_addr);pte_t entry;
drivers/macintosh/via-pmu.c +2 -2
@@ -2504,7 +2504,7 @@ powerbook_sleep_grackle(void)_set_L2CR (save_l2cr);/* Restore userland MMU context */ -set_context (current->active_mm->context, current->active_mm->pgd); +set_context (current->active_mm->context, (pml4_t *)current->active_mm->pml4);/* Power things up */ pmu_unlock ();
@@ -2604,7 +2604,7 @@ powerbook_sleep_Core99(void)_set_L3CR (save_l3cr);/* Restore userland MMU context */ -set_context (current->active_mm->context, current->active_mm->pgd); +set_context (current->active_mm->context, (pgd_t *)current->active_mm->pml4);/* Tell PMU we are ready */ pmu_unlock ();
include/asm-parisc/cacheflush.h +2 -2
@@ -113,7 +113,7 @@ static inline void flush_cache_range(strstatic inline pte_t *__translation_exists (struct mm_struct *mm,unsigned long addr) { -pgd_t *pgd =pgd_offset (mm, addr); +pgd_t *pgd =pml4_pgd_offset (pml4_offset (mm, addr), addr);pmd_t *pmd;pte_t *pte;
@@ -155,7 +155,7 @@ flush_user_cache_page_non_current(structpreempt_disable ();/* make us current */ -mtctl (__pa (vma->vm_mm->pgd),25 ); +mtctl (__pa (vma->vm_mm->pml4),25 );mtsp (vma->vm_mm->context,3 );flush_user_dcache_page (vmaddr);
include/asm-s390/tlbflush.h +1 -1
@@ -105,7 +105,7 @@ static inline void __flush_tlb_mm(structif (MACHINE_HAS_IDTE ) { asmvolatile (".insn rrf,0xb98e0000,0,%0,%1,0" : :"a" (2048 ), -"a" (__pa (mm->pgd)&PAGE_MASK ) :"cc" ); +"a" (__pa (mm->pml4)&PAGE_MASK ) :"cc" );return ; }preempt_disable ();
include/asm-sh/mmu_context.h +1 -1
@@ -133,7 +133,7 @@ static __inline__ void switch_mm(struct struct task_struct *tsk) {if (likely (prev != next)) { -unsigned long __pgdir = (unsigned long )next->pgd; +unsigned long __pgdir = (unsigned long )next->pml4; __asm__ __volatile__("mov.l %0, %1" : /* no output */
include/asm-sh/page.h +2 -0
@@ -139,6 +139,8 @@ static __inline__ int get_order(unsigned#endif +#include <asm-generic/nopml4-page.h> +#endif /* __KERNEL__ */ #endif /* __ASM_SH_PAGE_H */
include/asm-sh/pgalloc.h +2 -10
@@ -23,16 +23,6 @@ static inline void pmd_populate(struct m/* * Allocate and free page tables. */ -static inline pgd_t *pgd_alloc (struct mm_struct *mm) -{ -unsigned int pgd_size = (USER_PTRS_PER_PGD *sizeof (pgd_t)); -pgd_t *pgd = (pgd_t *)kmalloc (pgd_size,GFP_KERNEL ); - -if (pgd) -memset (pgd,0 , pgd_size); - -return pgd; -}static inline void pgd_free (pgd_t *pgd) {
@@ -90,4 +80,6 @@ static inline void pte_free(struct page#define PG_mapped PG_arch_1#endif +#include <asm-generic/nopml4-pgalloc.h> +#endif /* __ASM_SH_PGALLOC_H */
include/asm-sh/pgtable.h +4 -5
@@ -41,7 +41,7 @@ extern unsigned long empty_zero_page[102#define PGDIR_SIZE (1UL << PGDIR_SHIFT)#define PGDIR_MASK (~(PGDIR_SIZE-1)) -#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) +#define USER_PGDS_IN_LAST_PML4 (TASK_SIZE/PGDIR_SIZE)#define FIRST_USER_PGD_NR 0#define PTE_PHYS_MASK 0x1ffff000
@@ -231,10 +231,7 @@ static inline pte_t pte_modify(pte_t pte/* to find an entry in a page-table-directory. */ #define pgd_index (address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) -#define pgd_offset (mm, address) ((mm)->pgd+pgd_index(address)) - -/* to find an entry in a kernel page-table-directory */ -#define pgd_offset_k (address) pgd_offset(&init_mm, address) +#define pgd_index_k (address) pgd_index(address)/* Find an entry in the third-level page table.. */ #define pte_index (address) \
@@ -293,5 +290,7 @@ extern inline pte_t ptep_get_and_clear(p#include <asm-generic/pgtable.h> +#include <asm-generic/nopml4-pgtable.h> +#endif /* __ASM_SH_PAGE_H */
Quoted 6 lines · Andreas Kleen
4level support for sh
Converted, but doesn't compile for other reasons
Signed-off-by Andi Kleen <[email protected]>
I'll see about fixing up the build. On another note, it looks like these got grouped in accidentally:
Quoted 54 lines
diff -urpN -X ../KDIFX
linux-2.6.10rc1/drivers/macintosh/via-pmu.clinux-2.6.10rc1-4level/drivers/macintosh/via-pmu.cdrivers/macintosh/via-pmu.c +2
-2@@ -2504,7 +2504,7 @@ powerbook_sleep_grackle(void)_set_L2CR (save_l2cr);/* Restore userland MMU context */ -set_context (current->active_mm->context, current->active_mm->pgd); +set_context (current->active_mm->context, (pml4_t *)current->active_mm->pml4);/* Power things up */ pmu_unlock ();@@ -2604,7 +2604,7 @@ powerbook_sleep_Core99(void)_set_L3CR (save_l3cr);/* Restore userland MMU context */ -set_context (current->active_mm->context, current->active_mm->pgd); +set_context (current->active_mm->context, (pgd_t *)current->active_mm->pml4);/* Tell PMU we are ready */ pmu_unlock ();diff -urpN -X ../KDIFX
linux-2.6.10rc1/include/asm-parisc/cacheflush.hlinux-2.6.10rc1-4level/include/asm-parisc/cacheflush.hinclude/asm-parisc/cacheflush.h +2
-2@@ -113,7 +113,7 @@ static inline void flush_cache_range(strstatic inline pte_t *__translation_exists (struct mm_struct *mm,unsigned long addr) { -pgd_t *pgd =pgd_offset (mm, addr); +pgd_t *pgd =pml4_pgd_offset (pml4_offset (mm, addr), addr);pmd_t *pmd;pte_t *pte;@@ -155,7 +155,7 @@ flush_user_cache_page_non_current(structpreempt_disable ();/* make us current */ -mtctl (__pa (vma->vm_mm->pgd),25 ); +mtctl (__pa (vma->vm_mm->pml4),25 );mtsp (vma->vm_mm->context,3 );flush_user_dcache_page (vmaddr);diff -urpN -X ../KDIFX
linux-2.6.10rc1/include/asm-s390/tlbflush.hlinux-2.6.10rc1-4level/include/asm-s390/tlbflush.hinclude/asm-s390/tlbflush.h +1
-1@@ -105,7 +105,7 @@ static inline void __flush_tlb_mm(structif (MACHINE_HAS_IDTE ) { asmvolatile (".insn rrf,0xb98e0000,0,%0,%1,0" : :"a" (2048 ), -"a" (__pa (mm->pgd)&PAGE_MASK ) :"cc" ); +"a" (__pa (mm->pml4)&PAGE_MASK ) :"cc" );return ; }preempt_disable ();
Quoted 9 lines · Paul Mundt
Quoted 6 lines · Andreas Kleen
4level support for sh
Converted, but doesn't compile for other reasons
Signed-off-by Andi Kleen <[email protected]>I'll see about fixing up the build. On another note, it looks like these got grouped in accidentally:
Yes, scripting error. Here's an update patch without the bogus hunks:
BTW separate objdir build seems to be totally broken on sh and it adds random bogus symlinks to the source tree when you do that. Perhaps you can fix that too.
------------------------------------------------------------------------------------------
4level support for sh
Converted, but doesn't compile for other reasons
arch/sh/mm/cache-sh4.c +2 -2
@@ -301,7 +301,7 @@ void flush_cache_range(struct vm_area_stunsigned long phys;unsigned long d =0 ; - dir =pgd_offset (vma->vm_mm, p); + dir =pml4_pgd_offset (pml4_offset (vma->vm_mm, p), p); pmd =pmd_offset (dir, p); do {
@@ -354,7 +354,7 @@ void flush_cache_page(struct vm_area_strpte_t entry;unsigned long phys; - dir =pgd_offset (vma->vm_mm, address); + dir =pml4_pgd_offset (pml4_offset (vma->vm_mm, address), address); pmd =pmd_offset (dir, address);if (pmd_none (*pmd) ||pmd_bad (*pmd))return ;
arch/sh/mm/fault.c +2 -2
@@ -209,13 +209,13 @@ asmlinkage int __do_page_fault(struct pt#endif if (address >=P3SEG && address < addrmax) - dir =pgd_offset_k (address); + dir =pml4_pgd_offset (pml4_offset_k (address), address);else if (address >=TASK_SIZE )return 1 ;else if (!current->mm)return 1 ;else - dir =pgd_offset (current->mm, address); + dir =pml4_pgd_offset (pml4_offset (current->mm,address),address); pmd =pmd_offset (dir, address);if (pmd_none (*pmd))
arch/sh/mm/hugetlbpage.c +2 -2
@@ -30,7 +30,7 @@ static pte_t *huge_pte_alloc(struct mm_spmd_t *pmd;pte_t *pte =NULL ; - pgd =pgd_offset (mm, addr); + pgd =pml4_pgd_offset (pml4_offset (mm, addr), addr);if (pgd) { pmd =pmd_alloc (mm, pgd, addr);if (pmd)
@@ -45,7 +45,7 @@ static pte_t *huge_pte_offset(struct mm_pmd_t *pmd;pte_t *pte =NULL ; - pgd =pgd_offset (mm, addr); + pgd =pml4_pgd_offset (pml4_offset (mm, addr), addr);if (pgd) { pmd =pmd_offset (pgd, addr);if (pmd)
arch/sh/mm/init.c +11 -0
@@ -313,3 +313,14 @@ void free_initrd_mem(unsigned long start }#endif + +pgd_t *__pgd_alloc (struct mm_struct *mm,pml4_t *dummy,unsigned long addr) +{ +unsigned int pgd_size = (USER_PTRS_PER_PGD *sizeof (pgd_t)); +pgd_t *pgd = (pgd_t *)kmalloc (pgd_size,GFP_KERNEL ); + +if (pgd) +memset (pgd,0 , pgd_size); + +return pgd; +}
arch/sh/mm/ioremap.c +1 -1
@@ -75,7 +75,7 @@ int remap_area_pages(unsigned long addreunsigned long end = address + size; phys_addr -= address; - dir =pgd_offset_k (address); + dir =pml4_pgd_offset (pml4_offset_k (address), address);flush_cache_all ();if (address >= end)BUG ();
arch/sh/mm/pg-sh4.c +2 -2
@@ -42,7 +42,7 @@ void clear_user_page(void *to, unsigned _PAGE_HW_SHARED | _PAGE_FLAGS_HARD);unsigned long phys_addr =PHYSADDR (to);unsigned long p3_addr =P3SEG + (address &CACHE_ALIAS ); -pgd_t *dir =pgd_offset_k (p3_addr); +pgd_t *dir =pml4_pgd_offset (pml4_offset_k (p3_addr), p3_addr);pmd_t *pmd =pmd_offset (dir, p3_addr);pte_t *pte =pte_offset_kernel (pmd, p3_addr);pte_t entry;
@@ -81,7 +81,7 @@ void copy_user_page(void *to, void *from _PAGE_HW_SHARED | _PAGE_FLAGS_HARD);unsigned long phys_addr =PHYSADDR (to);unsigned long p3_addr =P3SEG + (address &CACHE_ALIAS ); -pgd_t *dir =pgd_offset_k (p3_addr); +pgd_t *dir =pml4_pgd_offset (pml4_offset_k (p3_addr), p3_addr);pmd_t *pmd =pmd_offset (dir, p3_addr);pte_t *pte =pte_offset_kernel (pmd, p3_addr);pte_t entry;
drivers/macintosh/via-pmu.c +2 -2
@@ -2504,7 +2504,7 @@ powerbook_sleep_grackle(void)_set_L2CR (save_l2cr);/* Restore userland MMU context */ -set_context (current->active_mm->context, current->active_mm->pgd); +set_context (current->active_mm->context, (pml4_t *)current->active_mm->pml4);/* Power things up */ pmu_unlock ();
@@ -2604,7 +2604,7 @@ powerbook_sleep_Core99(void)_set_L3CR (save_l3cr);/* Restore userland MMU context */ -set_context (current->active_mm->context, current->active_mm->pgd); +set_context (current->active_mm->context, (pgd_t *)current->active_mm->pml4);/* Tell PMU we are ready */ pmu_unlock ();
include/asm-sh/mmu_context.h +1 -1
@@ -133,7 +133,7 @@ static __inline__ void switch_mm(struct struct task_struct *tsk) {if (likely (prev != next)) { -unsigned long __pgdir = (unsigned long )next->pgd; +unsigned long __pgdir = (unsigned long )next->pml4; __asm__ __volatile__("mov.l %0, %1" : /* no output */
include/asm-sh/page.h +2 -0
@@ -139,6 +139,8 @@ static __inline__ int get_order(unsigned#endif +#include <asm-generic/nopml4-page.h> +#endif /* __KERNEL__ */ #endif /* __ASM_SH_PAGE_H */
include/asm-sh/pgalloc.h +2 -10
@@ -23,16 +23,6 @@ static inline void pmd_populate(struct m/* * Allocate and free page tables. */ -static inline pgd_t *pgd_alloc (struct mm_struct *mm) -{ -unsigned int pgd_size = (USER_PTRS_PER_PGD *sizeof (pgd_t)); -pgd_t *pgd = (pgd_t *)kmalloc (pgd_size,GFP_KERNEL ); - -if (pgd) -memset (pgd,0 , pgd_size); - -return pgd; -}static inline void pgd_free (pgd_t *pgd) {
@@ -90,4 +80,6 @@ static inline void pte_free(struct page#define PG_mapped PG_arch_1#endif +#include <asm-generic/nopml4-pgalloc.h> +#endif /* __ASM_SH_PGALLOC_H */
include/asm-sh/pgtable.h +4 -5
@@ -41,7 +41,7 @@ extern unsigned long empty_zero_page[102#define PGDIR_SIZE (1UL << PGDIR_SHIFT)#define PGDIR_MASK (~(PGDIR_SIZE-1)) -#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) +#define USER_PGDS_IN_LAST_PML4 (TASK_SIZE/PGDIR_SIZE)#define FIRST_USER_PGD_NR 0#define PTE_PHYS_MASK 0x1ffff000
@@ -231,10 +231,7 @@ static inline pte_t pte_modify(pte_t pte/* to find an entry in a page-table-directory. */ #define pgd_index (address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) -#define pgd_offset (mm, address) ((mm)->pgd+pgd_index(address)) - -/* to find an entry in a kernel page-table-directory */ -#define pgd_offset_k (address) pgd_offset(&init_mm, address) +#define pgd_index_k (address) pgd_index(address)/* Find an entry in the third-level page table.. */ #define pte_index (address) \
@@ -293,5 +290,7 @@ extern inline pte_t ptep_get_and_clear(p#include <asm-generic/pgtable.h> +#include <asm-generic/nopml4-pgtable.h> +#endif /* __ASM_SH_PAGE_H */
Quoted 4 lines · Andi Kleen
BTW separate objdir build seems to be totally broken on sh and it adds random bogus symlinks to the source tree when you do that. Perhaps you can fix that too.
Tom Rini was working on that stuff, I've not tested it myself. I thought this was all fixed by now though, Tom?
Quoted 7 lines · Paul Mundt
Quoted 4 lines · Andi Kleen
BTW separate objdir build seems to be totally broken on sh and it adds random bogus symlinks to the source tree when you do that. Perhaps you can fix that too.
Tom Rini was working on that stuff, I've not tested it myself. I thought this was all fixed by now though, Tom?
The last problem with SH and O= I found was with EMBEDDED_RAMDISK. Andi, can you be more specific about bogus symlinks ? Unless I broke something when copying from ARM, it shouldn't have any more, or less, problems than ARM for include/asm/foo symlinks.
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/
Quoted 6 lines · Tom Rini
Quoted 5 lines · Paul Mundt
Quoted 4 lines · Andi Kleen
BTW separate objdir build seems to be totally broken on sh and it adds random bogus symlinks to the source tree when you do that. Perhaps you can fix that too.
Quoted 7 lines
Quoted 2 lines
Tom Rini was working on that stuff, I've not tested it myself. I thought this was all fixed by now though, Tom?
The last problem with SH and O= I found was with
EMBEDDED_RAMDISK. Andi, can you be more specific about bogus symlinks ? Unless I broke something when copying from ARM, it shouldn't have any more, or less, problems than ARM forinclude/asm/foosymlinks.
I tried a separate objdir compilation which eventually didn't work. But my original source tree had several symlinks and a machtypes.h file now in include/asm-sh*/* which messed up diffs.
-Andi
Quoted 10 lines · Andi Kleen
Quoted 9 lines · Tom Rini
Quoted 7 lines · Paul Mundt
Quoted 4 lines · Andi Kleen
BTW separate objdir build seems to be totally broken on sh and it adds random bogus symlinks to the source tree when you do that. Perhaps you can fix that too.
Tom Rini was working on that stuff, I've not tested it myself. I thought this was all fixed by now though, Tom?
Quoted 8 lines
Quoted 4 lines
The last problem with SH and O= I found was with
EMBEDDED_RAMDISK. Andi, can you be more specific about bogus symlinks ? Unless I broke something when copying from ARM, it shouldn't have any more, or less, problems than ARM forinclude/asm/foosymlinks.I tried a separate objdir compilation which eventually didn't work. But my original source tree had several symlinks and a
machtypes.hfile now ininclude/asm-sh*/*which messed up diffs.
Was this stock 2.6.9 or -bk at some point? All of the O= changes went in after 2.6.9 went out as part of akpm's first resync.
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/
Quoted 16 lines · Tom Rini
Quoted 15 lines · Andi Kleen
Quoted 13 lines · Tom Rini
Quoted 7 lines · Paul Mundt
Quoted 4 lines · Andi Kleen
BTW separate objdir build seems to be totally broken on sh and it adds random bogus symlinks to the source tree when you do that. Perhaps you can fix that too.
Tom Rini was working on that stuff, I've not tested it myself. I thought this was all fixed by now though, Tom?
The last problem with SH and O= I found was with
EMBEDDED_RAMDISK. Andi, can you be more specific about bogus symlinks ? Unless I broke something when copying from ARM, it shouldn't have any more, or less, problems than ARM forinclude/asm/foosymlinks.
Quoted 6 lines
Quoted 3 lines
I tried a separate objdir compilation which eventually didn't work. But my original source tree had several symlinks and a
machtypes.hfile now ininclude/asm-sh*/*which messed up diffs.Was this stock 2.6.9 or -bk at some point? All of the O= changes went in after 2.6.9 went out as part of akpm's first resync.
Stock 2.6.9
-Andi