{"id":216,"url":"http://patchwork.ozlabs.org/api/1.0/patches/216/?format=json","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/1.0/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/"},"msgid":"<20080909050447.GC30127@yookeroo.seuss>","date":"2008-09-09T05:04:47","name":"Get USE_STRICT_MM_TYPECHECKS working again","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":true,"hash":"b0949f87247d73a20b79e97f4b9577b0a66b7a2b","submitter":{"id":47,"url":"http://patchwork.ozlabs.org/api/1.0/people/47/?format=json","name":"David Gibson","email":"david@gibson.dropbear.id.au"},"delegate":{"id":13,"url":"http://patchwork.ozlabs.org/api/1.0/users/13/?format=json","username":"paulus","first_name":"Paul","last_name":"Mackerras","email":"paulus@samba.org"},"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20080909050447.GC30127@yookeroo.seuss/mbox/","series":[],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/216/checks/","tags":{},"headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork=ozlabs.org@ozlabs.org>","X-Original-To":["patchwork@ozlabs.org","linuxppc-dev@ozlabs.org"],"Delivered-To":["patchwork@ozlabs.org","linuxppc-dev@ozlabs.org"],"Received":["from ozlabs.org (localhost [127.0.0.1])\n\tby ozlabs.org (Postfix) with ESMTP id 46F90DE13E\n\tfor <patchwork@ozlabs.org>; Tue,  9 Sep 2008 15:05:10 +1000 (EST)","by ozlabs.org (Postfix, from userid 1007)\n\tid 2142FDDE22; Tue,  9 Sep 2008 15:04:49 +1000 (EST)"],"Date":"Tue, 9 Sep 2008 15:04:47 +1000","From":"David Gibson <david@gibson.dropbear.id.au>","To":"Paul Mackerras <paulus@samba.org>","Subject":"Get USE_STRICT_MM_TYPECHECKS working again","Message-ID":"<20080909050447.GC30127@yookeroo.seuss>","Mail-Followup-To":"Paul Mackerras <paulus@samba.org>, linuxppc-dev@ozlabs.org","MIME-Version":"1.0","Content-Disposition":"inline","User-Agent":"Mutt/1.5.17+20080114 (2008-01-14)","Cc":"linuxppc-dev@ozlabs.org","X-BeenThere":"linuxppc-dev@ozlabs.org","X-Mailman-Version":"2.1.11","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>","List-Unsubscribe":"<https://ozlabs.org/mailman/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe>","List-Archive":"<http://ozlabs.org/pipermail/linuxppc-dev>","List-Post":"<mailto:linuxppc-dev@ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@ozlabs.org?subject=help>","List-Subscribe":"<https://ozlabs.org/mailman/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"linuxppc-dev-bounces+patchwork=ozlabs.org@ozlabs.org","Errors-To":"linuxppc-dev-bounces+patchwork=ozlabs.org@ozlabs.org"},"content":"The typesafe version of the powerpc pagetable handling (with\nUSE_STRICT_MM_TYPECHECKS defined) has bitrotted again.  This patch\nmakes a bunch of small fixes to get it building again.\n\nSigned-off-by: David Gibson <david@gibson.dropbear.id.au>","diff":"Index: working-2.6/arch/powerpc/include/asm/pgtable-ppc64.h\n===================================================================\n--- working-2.6.orig/arch/powerpc/include/asm/pgtable-ppc64.h\t2008-09-09 14:17:27.000000000 +1000\n+++ working-2.6/arch/powerpc/include/asm/pgtable-ppc64.h\t2008-09-09 14:17:31.000000000 +1000\n@@ -117,10 +117,10 @@\n #define PAGE_AGP\t__pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_NO_CACHE)\n #define HAVE_PAGE_AGP\n \n-#define PAGE_PROT_BITS\t__pgprot(_PAGE_GUARDED | _PAGE_COHERENT | \\\n-\t\t\t\t _PAGE_NO_CACHE | _PAGE_WRITETHRU | \\\n-\t\t\t\t _PAGE_4K_PFN | _PAGE_RW | _PAGE_USER | \\\n- \t\t\t\t _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_EXEC)\n+#define PAGE_PROT_BITS\t(_PAGE_GUARDED | _PAGE_COHERENT | \\\n+\t\t\t _PAGE_NO_CACHE | _PAGE_WRITETHRU |\t\t\\\n+\t\t\t _PAGE_4K_PFN | _PAGE_RW | _PAGE_USER |\t\t\\\n+\t\t\t _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_EXEC)\n /* PTEIDX nibble */\n #define _PTEIDX_SECONDARY\t0x8\n #define _PTEIDX_GROUP_IX\t0x7\n@@ -264,9 +264,9 @@ static inline pte_t pte_mkhuge(pte_t pte\n \treturn pte; }\n static inline pte_t pte_mkspecial(pte_t pte) {\n \tpte_val(pte) |= _PAGE_SPECIAL; return pte; }\n-static inline unsigned long pte_pgprot(pte_t pte)\n+static inline pgprot_t pte_pgprot(pte_t pte)\n {\n-\treturn __pgprot(pte_val(pte)) & PAGE_PROT_BITS;\n+\treturn __pgprot(pte_val(pte) & PAGE_PROT_BITS);\n }\n \n /* Atomic PTE updates */\nIndex: working-2.6/arch/powerpc/include/asm/pgtable-ppc32.h\n===================================================================\n--- working-2.6.orig/arch/powerpc/include/asm/pgtable-ppc32.h\t2008-09-02 11:50:12.000000000 +1000\n+++ working-2.6/arch/powerpc/include/asm/pgtable-ppc32.h\t2008-09-09 14:17:31.000000000 +1000\n@@ -415,11 +415,11 @@ extern int icache_44x_need_flush;\n #define _PAGE_CHG_MASK\t(PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)\n \n \n-#define PAGE_PROT_BITS\t__pgprot(_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \\\n-\t\t\t\t _PAGE_WRITETHRU | _PAGE_ENDIAN | \\\n-\t\t\t\t _PAGE_USER | _PAGE_ACCESSED | \\\n-\t\t\t\t _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | \\\n-\t\t\t\t _PAGE_EXEC | _PAGE_HWEXEC)\n+#define PAGE_PROT_BITS\t(_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \\\n+\t\t\t _PAGE_WRITETHRU | _PAGE_ENDIAN | \\\n+\t\t\t _PAGE_USER | _PAGE_ACCESSED | \\\n+\t\t\t _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | \\\n+\t\t\t _PAGE_EXEC | _PAGE_HWEXEC)\n /*\n  * Note: the _PAGE_COHERENT bit automatically gets set in the hardware\n  * PTE if CONFIG_SMP is defined (hash_page does this); there is no need\n@@ -553,9 +553,9 @@ static inline pte_t pte_mkyoung(pte_t pt\n \tpte_val(pte) |= _PAGE_ACCESSED; return pte; }\n static inline pte_t pte_mkspecial(pte_t pte) {\n \treturn pte; }\n-static inline unsigned long pte_pgprot(pte_t pte)\n+static inline pgprot_t pte_pgprot(pte_t pte)\n {\n-\treturn __pgprot(pte_val(pte)) & PAGE_PROT_BITS;\n+\treturn __pgprot(pte_val(pte) & PAGE_PROT_BITS);\n }\n \n static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)\nIndex: working-2.6/arch/powerpc/include/asm/mman.h\n===================================================================\n--- working-2.6.orig/arch/powerpc/include/asm/mman.h\t2008-09-02 11:50:12.000000000 +1000\n+++ working-2.6/arch/powerpc/include/asm/mman.h\t2008-09-09 14:17:31.000000000 +1000\n@@ -44,7 +44,7 @@ static inline unsigned long arch_calc_vm\n \n static inline pgprot_t arch_vm_get_page_prot(unsigned long vm_flags)\n {\n-\treturn (vm_flags & VM_SAO) ? __pgprot(_PAGE_SAO) : 0;\n+\treturn (vm_flags & VM_SAO) ? __pgprot(_PAGE_SAO) : __pgprot(0);\n }\n #define arch_vm_get_page_prot(vm_flags) arch_vm_get_page_prot(vm_flags)\n \nIndex: working-2.6/arch/powerpc/mm/gup.c\n===================================================================\n--- working-2.6.orig/arch/powerpc/mm/gup.c\t2008-09-08 14:27:32.000000000 +1000\n+++ working-2.6/arch/powerpc/mm/gup.c\t2008-09-09 14:22:18.000000000 +1000\n@@ -41,7 +41,7 @@ static noinline int gup_pte_range(pmd_t \n \t\tpage = pte_page(pte);\n \t\tif (!page_cache_get_speculative(page))\n \t\t\treturn 0;\n-\t\tif (unlikely(pte != *ptep)) {\n+\t\tif (unlikely(pte_val(pte) != pte_val(*ptep))) {\n \t\t\tput_page(page);\n \t\t\treturn 0;\n \t\t}\n@@ -92,7 +92,7 @@ static noinline int gup_huge_pte(pte_t *\n \t\t*nr -= refs;\n \t\treturn 0;\n \t}\n-\tif (unlikely(pte != *ptep)) {\n+\tif (unlikely(pte_val(pte) != pte_val(*ptep))) {\n \t\t/* Could be optimized better */\n \t\twhile (*nr) {\n \t\t\tput_page(page);\n@@ -237,7 +237,8 @@ int get_user_pages_fast(unsigned long st\n \t\t\tpgd_t pgd = *pgdp;\n \n \t\t\tVM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, addr)].shift);\n-\t\t\tpr_debug(\"  %016lx: normal pgd %p\\n\", addr, (void *)pgd);\n+\t\t\tpr_debug(\"  %016lx: normal pgd %p\\n\", addr,\n+\t\t\t\t (void *)pgd_val(pgd));\n \t\t\tnext = pgd_addr_end(addr, end);\n \t\t\tif (pgd_none(pgd))\n \t\t\t\tgoto slow;\nIndex: working-2.6/arch/powerpc/mm/hash_utils_64.c\n===================================================================\n--- working-2.6.orig/arch/powerpc/mm/hash_utils_64.c\t2008-09-09 14:17:27.000000000 +1000\n+++ working-2.6/arch/powerpc/mm/hash_utils_64.c\t2008-09-09 14:17:31.000000000 +1000\n@@ -539,7 +539,7 @@ static unsigned long __init htab_get_tab\n void create_section_mapping(unsigned long start, unsigned long end)\n {\n \tBUG_ON(htab_bolt_mapping(start, end, __pa(start),\n-\t\t\t\t PAGE_KERNEL, mmu_linear_psize,\n+\t\t\t\t pgprot_val(PAGE_KERNEL), mmu_linear_psize,\n \t\t\t\t mmu_kernel_ssize));\n }\n \n@@ -647,7 +647,7 @@ void __init htab_initialize(void)\n \t\tmtspr(SPRN_SDR1, _SDR1);\n \t}\n \n-\tprot = PAGE_KERNEL;\n+\tprot = pgprot_val(PAGE_KERNEL);\n \n #ifdef CONFIG_DEBUG_PAGEALLOC\n \tlinear_map_hash_count = lmb_end_of_DRAM() >> PAGE_SHIFT;\nIndex: working-2.6/arch/powerpc/mm/init_64.c\n===================================================================\n--- working-2.6.orig/arch/powerpc/mm/init_64.c\t2008-09-08 14:27:32.000000000 +1000\n+++ working-2.6/arch/powerpc/mm/init_64.c\t2008-09-09 14:17:31.000000000 +1000\n@@ -228,8 +228,8 @@ int __meminit vmemmap_populate(struct pa\n \t\t\tstart, p, __pa(p));\n \n \t\tmapped = htab_bolt_mapping(start, start + page_size, __pa(p),\n-\t\t\t\t\t   PAGE_KERNEL, mmu_vmemmap_psize,\n-\t\t\t\t\t   mmu_kernel_ssize);\n+\t\t\t\t\t   pgprot_val(PAGE_KERNEL),\n+\t\t\t\t\t   mmu_vmemmap_psize, mmu_kernel_ssize);\n \t\tBUG_ON(mapped < 0);\n \t}\n \n","prefixes":[]}