* [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures
@ 2009-05-01 14:42 Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 01/35] rename arm and frv's __pte_index() Dave Hansen
` (34 more replies)
0 siblings, 35 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
I want to use pte_offset_map() and pte_unmap() for nefarious
purposes. But, there are too many dang implementations
in all the architectures. These patches set out to
consolidate them.
These are mostly one patch per arch to make it easier for
the individual arch maintainers to go and look at only the
bits that they care about.
In the end, we go from 34 implementations of
pte_offset_map{_nested}() and pte_unmap{_nested}() to only
three:
1. all highpte implementations (x86, ppc32, frv)
2. all direct-mapped pte implementations (everything almost)
3. SUN3-based m68k
The SUN3 one is special because it uses kmap() instead of
kmap_atomic() for which it is wholly unique.
The diffstat is long, but here's the summary. Pretty cool
considering that 41 of these lines are just for #includes.
67 files changed, 62 insertions(+), 196 deletions(-)
The steps are as follows, and should be bisectable:
1. Break out all the functions into a new asm/ptemap.h and
include it in place of the original functions.
2. Move linux/mm.h arch-independent pte mapping code to
linux/ptemap.h, include asm/ptemap.h there
3. Include linux/ptemap.h directly at all use sites
(only 39 of these kernel-wide)
4. Standardize all the implementations to use
pte_offset_kernel() as the basis for pte_offset_map()
whenever possible.
5. Create asm-generic/ptemap.h and consolidate all the
architectures that share the pte_offset_kernel()
implementations.
6. Consolidate the three HIGHPTE implementations (x86,
frv, ppc64) in asm-generic/ptemap.h.
7. Remove the direct asm/ptemap.h includes.
This passes my compile tests on x86, x86_64, sparc, sparc64
s390, ppc64, ppc32, m68k, arm and alpha.
The pte_offset_kernel() migrations help fix the issue
that there are two basical variants of pte_offset_map()
which is the same for pte_offset_kernel() for !HIGHPTE
(this has a few casts removed for clarity):
#define pte_offset_map(dir, address) \
(page_address(pmd_page(*dir)) + pte_index(address))
and
#define pte_offset_map(dir, address) \
(pmd_page_vaddr(*dir) + pte_index(addr))
As you can see, the pte_index() is exactly the same. The
only question is if
page_address(pmd_page(*dir))
and
pmd_page_vaddr(*dir)
are equivalent. I claim they are and that the pmd_page_vaddr()
version is superior since it doesn't need to do the conversion
to a 'struct page' and back.
Let's look at those with pmd_page_vaddr() and pmd_page expanded:
page_address(pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
__va(pmd_val(pmd) & PTE_PFN_MASK)
pmd pages are never in highmem, so page_address() is always
effectively lowmem_page_address(). Epanding that, we have:
__va(page_to_pfn(pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) << PAGE_SHIFT)
doing page_to_pfn(pfn_to_page()) is a noop, so that simplifies
to:
__va((pmd_val(pmd) >> PAGE_SHIFT) << PAGE_SHIFT)
which we're comparing to:
__va(pmd_val(pmd) & PTE_PFN_MASK)
the '>> PAGE_SHIFT << PAGE_SHIFT' just has the effect of
masking out some low bits, which is exactly what
'& PTE_PFN_MASK' does.
67 files changed, 62 insertions(+), 196 deletions(-)
arch/alpha/include/asm/pgtable.h | 5 +----
arch/arm/include/asm/pgtable.h | 8 ++------
arch/arm/kernel/traps.c | 1 +
arch/arm/mm/fault-armv.c | 1 +
arch/arm/mm/fault.c | 1 +
arch/arm/mm/pgd.c | 1 +
arch/cris/include/asm/pgtable.h | 6 ------
arch/frv/include/asm/highmem.h | 5 +++++
arch/frv/include/asm/pgtable.h | 17 +----------------
arch/frv/kernel/gdb-stub.c | 2 +-
arch/frv/mm/fault.c | 2 +-
arch/ia64/include/asm/pgtable.h | 4 ----
arch/ia64/mm/hugetlbpage.c | 1 +
arch/m32r/include/asm/pgtable.h | 5 -----
arch/m68k/include/asm/motorola_pgtable.h | 5 -----
arch/m68k/include/asm/sun3_pgtable.h | 5 -----
arch/m68k/mm/kmap.c | 1 +
arch/mips/include/asm/pgtable-32.h | 10 +---------
arch/mips/include/asm/pgtable-64.h | 10 +---------
arch/mips/mm/tlb-r4k.c | 1 +
arch/mips/mm/tlb-r8k.c | 1 +
arch/mn10300/include/asm/pgtable.h | 6 ------
arch/mn10300/mm/cache.c | 1 +
arch/parisc/include/asm/pgtable.h | 7 -------
arch/parisc/kernel/cache.c | 1 +
arch/parisc/kernel/pci-dma.c | 2 ++
arch/powerpc/Kconfig | 4 ++++
arch/powerpc/include/asm/pgtable-ppc32.h | 8 --------
arch/powerpc/include/asm/pgtable-ppc64.h | 5 -----
arch/powerpc/mm/pgtable_32.c | 1 +
arch/powerpc/mm/pgtable_64.c | 1 +
arch/powerpc/mm/subpage-prot.c | 1 +
arch/s390/include/asm/pgtable.h | 4 ----
arch/s390/lib/uaccess_pt.c | 1 +
arch/sh/include/asm/pgtable_32.h | 5 -----
arch/sh/include/asm/pgtable_64.h | 5 -----
arch/sh/mm/cache-sh5.c | 1 +
arch/sh/mm/hugetlbpage.c | 1 +
arch/sparc/include/asm/pgtable_32.h | 15 ---------------
arch/sparc/include/asm/pgtable_64.h | 14 +++++---------
arch/sparc/kernel/signal32.c | 1 +
arch/sparc/mm/fault_64.c | 1 +
arch/sparc/mm/generic_64.c | 1 +
arch/sparc/mm/hugetlbpage.c | 1 +
arch/sparc/mm/io-unit.c | 1 +
arch/sparc/mm/iommu.c | 1 +
arch/um/include/asm/pgtable.h | 6 ------
arch/um/kernel/tlb.c | 1 +
arch/x86/include/asm/pgtable_32.h | 17 -----------------
arch/x86/include/asm/pgtable_64.h | 6 ------
arch/x86/kernel/vm86_32.c | 1 +
arch/x86/mm/gup.c | 1 +
arch/xtensa/include/asm/pgtable.h | 6 ------
fs/proc/task_mmu.c | 1 +
include/linux/mm.h | 26 --------------------------
lib/ioremap.c | 1 +
mm/fremap.c | 1 +
mm/memory.c | 1 +
mm/mempolicy.c | 1 +
mm/migrate.c | 1 +
mm/mincore.c | 1 +
mm/mprotect.c | 1 +
mm/mremap.c | 1 +
mm/pagewalk.c | 1 +
mm/rmap.c | 1 +
mm/swapfile.c | 1 +
mm/vmalloc.c | 1 +
67 files changed, 62 insertions(+), 196 deletions(-)
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 01/35] rename arm and frv's __pte_index()
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 02/35] rework sparc pte functions to be consistent with other arches Dave Hansen
` (33 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
The arm and frv __pte_index()es are the exact same as everyone
else's pte_index(). So, remove the __ and give them the same
name as all the other implementations.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/arm/include/asm/pgtable.h | 8 ++++----
linux-2.6.git-dave/arch/frv/include/asm/pgtable.h | 2 +-
linux-2.6.git-dave/arch/frv/kernel/gdb-stub.c | 2 +-
linux-2.6.git-dave/arch/frv/mm/fault.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff -puN arch/arm/include/asm/pgtable.h~rename-arm-__pte_index arch/arm/include/asm/pgtable.h
--- linux-2.6.git/arch/arm/include/asm/pgtable.h~rename-arm-__pte_index 2009-04-30 15:10:53.000000000 -0700
+++ linux-2.6.git-dave/arch/arm/include/asm/pgtable.h 2009-04-30 15:10:53.000000000 -0700
@@ -263,9 +263,9 @@ extern struct page *empty_zero_page;
#define pte_none(pte) (!pte_val(pte))
#define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0)
#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
-#define pte_offset_kernel(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr))
-#define pte_offset_map(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr))
-#define pte_offset_map_nested(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr))
+#define pte_offset_kernel(dir,addr) (pmd_page_vaddr(*(dir)) + pte_index(addr))
+#define pte_offset_map(dir,addr) (pmd_page_vaddr(*(dir)) + pte_index(addr))
+#define pte_offset_map_nested(dir,addr) (pmd_page_vaddr(*(dir)) + pte_index(addr))
#define pte_unmap(pte) do { } while (0)
#define pte_unmap_nested(pte) do { } while (0)
@@ -373,7 +373,7 @@ static inline pte_t *pmd_page_vaddr(pmd_
#define pmd_offset(dir, addr) ((pmd_t *)(dir))
/* Find an entry in the third-level page table.. */
-#define __pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
+#define pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{
diff -puN arch/frv/include/asm/pgtable.h~rename-arm-__pte_index arch/frv/include/asm/pgtable.h
--- linux-2.6.git/arch/frv/include/asm/pgtable.h~rename-arm-__pte_index 2009-04-30 15:10:53.000000000 -0700
+++ linux-2.6.git-dave/arch/frv/include/asm/pgtable.h 2009-04-30 15:10:53.000000000 -0700
@@ -436,7 +436,7 @@ static inline pte_t pte_modify(pte_t pte
#define pgd_index_k(addr) pgd_index(addr)
/* Find an entry in the bottom-level page table.. */
-#define __pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
+#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
/*
* the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
diff -puN arch/frv/kernel/gdb-stub.c~rename-arm-__pte_index arch/frv/kernel/gdb-stub.c
--- linux-2.6.git/arch/frv/kernel/gdb-stub.c~rename-arm-__pte_index 2009-04-30 15:10:53.000000000 -0700
+++ linux-2.6.git-dave/arch/frv/kernel/gdb-stub.c 2009-04-30 15:10:53.000000000 -0700
@@ -465,7 +465,7 @@ static inline unsigned long gdbstub_virt
__set_DAMPR(5, val | xAMPRx_L | xAMPRx_SS_16Kb | xAMPRx_S | xAMPRx_C | xAMPRx_V);
/* now its safe to access pmd */
- pte = (pte_t *)__get_DAMLR(5) + __pte_index(vaddr);
+ pte = (pte_t *)__get_DAMLR(5) + pte_index(vaddr);
if (pte_present(*pte))
val = pte_val(*pte);
else
diff -puN arch/frv/mm/fault.c~rename-arm-__pte_index arch/frv/mm/fault.c
--- linux-2.6.git/arch/frv/mm/fault.c~rename-arm-__pte_index 2009-04-30 15:10:53.000000000 -0700
+++ linux-2.6.git-dave/arch/frv/mm/fault.c 2009-04-30 15:10:53.000000000 -0700
@@ -240,7 +240,7 @@ asmlinkage void do_page_fault(int datamm
: "r" (_pme | xAMPRx_L|xAMPRx_SS_16Kb|xAMPRx_S|xAMPRx_C|xAMPRx_V)
);
- pte = (pte_t *) damlr + __pte_index(ear0);
+ pte = (pte_t *) damlr + pte_index(ear0);
val = pte_val(*pte);
asm volatile("movgs %0,dampr2" :: "r" (dampr));
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 02/35] rework sparc pte functions to be consistent with other arches
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 01/35] rename arm and frv's __pte_index() Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 03/35] alpha: create ptemap.h Dave Hansen
` (32 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
sparc64 has a unique unusual pte_index(). All other architectures
just take a virtual address and give back the offset inside the
pte page of that address's pte.
The sparc64 one actually takes both the pmd_t and the virtual
address and returns the pte_t itself. This is more akin to what
pte_offset_map() does on all the other implementations.
This patch adds a new implementations of pte_index() and
pmd_page_vaddr() which are pretty straighforward and just copied
from other architectures.
Then, we use the new functions in pte_offset_kernel(). We use
pte_offset_kernel() as the base from which we define
pte_offset_map() and pte_offset_map_nested().
All of this brings sparc64 back inline with what all the other
architectures are doing and prepares it for things to come. :)
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/sparc/include/asm/pgtable_64.h | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff -puN arch/sparc/include/asm/pgtable_64.h~rename-sparc-pte_index arch/sparc/include/asm/pgtable_64.h
--- linux-2.6.git/arch/sparc/include/asm/pgtable_64.h~rename-sparc-pte_index 2009-04-30 15:10:53.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/include/asm/pgtable_64.h 2009-04-30 15:10:53.000000000 -0700
@@ -619,6 +619,7 @@ static inline int pte_special(pte_t pte)
#define __pmd_page(pmd) \
((unsigned long) __va((((unsigned long)pmd_val(pmd))<<11UL)))
#define pmd_page(pmd) virt_to_page((void *)__pmd_page(pmd))
+#define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
#define pud_page_vaddr(pud) \
((unsigned long) __va((((unsigned long)pud_val(pud))<<11UL)))
#define pud_page(pud) virt_to_page((void *)pud_page_vaddr(pud))
@@ -646,13 +647,13 @@ static inline int pte_special(pte_t pte)
((pmd_t *) pud_page_vaddr(*(pudp)) + \
(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)))
+#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
+
/* Find an entry in the third-level page table.. */
-#define pte_index(dir, address) \
- ((pte_t *) __pmd_page(*(dir)) + \
- ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
-#define pte_offset_kernel pte_index
-#define pte_offset_map pte_index
-#define pte_offset_map_nested pte_index
+#define pte_offset_kernel(dir, address) \
+ ((pte_t *)pmd_page_vaddr(*(dir)) + pte_index(address))
+#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
+#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
#define pte_unmap(pte) do { } while (0)
#define pte_unmap_nested(pte) do { } while (0)
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 03/35] alpha: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 01/35] rename arm and frv's __pte_index() Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 02/35] rework sparc pte functions to be consistent with other arches Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 04/35] arm: " Dave Hansen
` (31 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/alpha/include/asm/pgtable.h | 5 +----
linux-2.6.git-dave/arch/alpha/include/asm/ptemap.h | 9 +++++++++
2 files changed, 10 insertions(+), 4 deletions(-)
diff -puN arch/alpha/include/asm/pgtable.h~alpha-ptemaph arch/alpha/include/asm/pgtable.h
--- linux-2.6.git/arch/alpha/include/asm/pgtable.h~alpha-ptemaph 2009-04-30 15:10:54.000000000 -0700
+++ linux-2.6.git-dave/arch/alpha/include/asm/pgtable.h 2009-04-30 15:10:54.000000000 -0700
@@ -317,10 +317,7 @@ extern inline pte_t * pte_offset_kernel(
return ret;
}
-#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
-#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+#inclue <asm/ptemap.h>
extern pgd_t swapper_pg_dir[1024];
diff -puN /dev/null arch/alpha/include/asm/ptemap.h
--- /dev/null 2008-09-02 09:40:19.000000000 -0700
+++ linux-2.6.git-dave/arch/alpha/include/asm/ptemap.h 2009-04-30 15:10:54.000000000 -0700
@@ -0,0 +1,9 @@
+#ifndef _ALPHA_ASM_PTEMAP_H
+#define _ALPHA_ASM_PTEMAP_H
+
+#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
+#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _ALPHA_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 04/35] arm: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (2 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 03/35] alpha: create ptemap.h Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 05/35] avr32: " Dave Hansen
` (30 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/arm/include/asm/pgtable.h | 6 ++----
linux-2.6.git-dave/arch/arm/include/asm/ptemap.h | 9 +++++++++
2 files changed, 11 insertions(+), 4 deletions(-)
diff -puN arch/arm/include/asm/pgtable.h~arm-ptemaph arch/arm/include/asm/pgtable.h
--- linux-2.6.git/arch/arm/include/asm/pgtable.h~arm-ptemaph 2009-04-30 15:10:54.000000000 -0700
+++ linux-2.6.git-dave/arch/arm/include/asm/pgtable.h 2009-04-30 15:10:54.000000000 -0700
@@ -264,10 +264,8 @@ extern struct page *empty_zero_page;
#define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0)
#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
#define pte_offset_kernel(dir,addr) (pmd_page_vaddr(*(dir)) + pte_index(addr))
-#define pte_offset_map(dir,addr) (pmd_page_vaddr(*(dir)) + pte_index(addr))
-#define pte_offset_map_nested(dir,addr) (pmd_page_vaddr(*(dir)) + pte_index(addr))
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+
+#include <asm/ptemap.h>
#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
diff -puN /dev/null arch/arm/include/asm/ptemap.h
--- /dev/null 2008-09-02 09:40:19.000000000 -0700
+++ linux-2.6.git-dave/arch/arm/include/asm/ptemap.h 2009-04-30 15:10:54.000000000 -0700
@@ -0,0 +1,9 @@
+#ifndef _ARM_ASM_PTEMAP_H
+#define _ARM_ASM_PTEMAP_H
+
+#define pte_offset_map(dir,addr) (pmd_page_vaddr(*(dir)) + pte_index(addr))
+#define pte_offset_map_nested(dir,addr) (pmd_page_vaddr(*(dir)) + pte_index(addr))
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _ARM_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 05/35] avr32: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (3 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 04/35] arm: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 06/35] cris: " Dave Hansen
` (29 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/avr32/include/asm/ptemap.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff -puN /dev/null arch/avr32/include/asm/ptemap.h
--- /dev/null 2008-09-02 09:40:19.000000000 -0700
+++ linux-2.6.git-dave/arch/avr32/include/asm/ptemap.h 2009-04-30 15:10:55.000000000 -0700
@@ -0,0 +1,9 @@
+#ifndef _AVR32_ASM_PTEMAP_H
+#define _AVR32_ASM_PTEMAP_H
+
+#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
+#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _AVR32_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 06/35] cris: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (4 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 05/35] avr32: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 07/35] frv: " Dave Hansen
` (28 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/cris/include/asm/pgtable.h | 7 +------
linux-2.6.git-dave/arch/cris/include/asm/ptemap.h | 11 +++++++++++
2 files changed, 12 insertions(+), 6 deletions(-)
diff -puN arch/cris/include/asm/pgtable.h~cris-ptemaph arch/cris/include/asm/pgtable.h
--- linux-2.6.git/arch/cris/include/asm/pgtable.h~cris-ptemaph 2009-04-30 15:10:56.000000000 -0700
+++ linux-2.6.git-dave/arch/cris/include/asm/pgtable.h 2009-04-30 15:10:56.000000000 -0700
@@ -244,12 +244,7 @@ static inline pgd_t * pgd_offset(const s
(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
-
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+#include <asm/ptemap.h>
#define pte_pfn(x) ((unsigned long)(__va((x).pte)) >> PAGE_SHIFT)
#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
diff -puN arch/cris/include/asm/ptemap.h~cris-ptemaph arch/cris/include/asm/ptemap.h
--- linux-2.6.git/arch/cris/include/asm/ptemap.h~cris-ptemaph 2009-04-30 15:10:56.000000000 -0700
+++ linux-2.6.git-dave/arch/cris/include/asm/ptemap.h 2009-04-30 15:10:56.000000000 -0700
@@ -0,0 +1,11 @@
+#ifndef _CRIS_ASM_PTEMAP_H
+#define _CRIS_ASM_PTEMAP_H
+
+#define pte_offset_map(dir, address) \
+ ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
+#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
+
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _CRIS_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 07/35] frv: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (5 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 06/35] cris: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 08/35] ia64: " Dave Hansen
` (27 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/frv/include/asm/pgtable.h | 15 +--------------
linux-2.6.git-dave/arch/frv/include/asm/ptemap.h | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 14 deletions(-)
diff -puN arch/frv/include/asm/pgtable.h~frv-ptemaph arch/frv/include/asm/pgtable.h
--- linux-2.6.git/arch/frv/include/asm/pgtable.h~frv-ptemaph 2009-04-30 15:10:56.000000000 -0700
+++ linux-2.6.git-dave/arch/frv/include/asm/pgtable.h 2009-04-30 15:10:56.000000000 -0700
@@ -449,20 +449,7 @@ static inline pte_t pte_modify(pte_t pte
#define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
-#if defined(CONFIG_HIGHPTE)
-#define pte_offset_map(dir, address) \
- ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE0) + pte_index(address))
-#define pte_offset_map_nested(dir, address) \
- ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE1) + pte_index(address))
-#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
-#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
-#else
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
-#define pte_offset_map_nested(dir, address) pte_offset_map((dir), (address))
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-#endif
+#include <asm/ptemap.h>
/*
* Handle swap and file entries
diff -puN arch/frv/include/asm/ptemap.h~frv-ptemaph arch/frv/include/asm/ptemap.h
--- linux-2.6.git/arch/frv/include/asm/ptemap.h~frv-ptemaph 2009-04-30 15:10:56.000000000 -0700
+++ linux-2.6.git-dave/arch/frv/include/asm/ptemap.h 2009-04-30 15:10:56.000000000 -0700
@@ -0,0 +1,19 @@
+#ifndef _FRV_ASM_PTEMAP_H
+#define _FRV_ASM_PTEMAP_H
+
+#if defined(CONFIG_HIGHPTE)
+#define pte_offset_map(dir, address) \
+ ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE0) + pte_index(address))
+#define pte_offset_map_nested(dir, address) \
+ ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE1) + pte_index(address))
+#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
+#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
+#else
+#define pte_offset_map(dir, address) \
+ ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
+#define pte_offset_map_nested(dir, address) pte_offset_map((dir), (address))
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+#endif
+
+#endif /* _FRV_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 08/35] ia64: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (6 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 07/35] frv: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 09/35] m32r: " Dave Hansen
` (26 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/ia64/include/asm/pgtable.h | 6 ++----
linux-2.6.git-dave/arch/ia64/include/asm/ptemap.h | 9 +++++++++
2 files changed, 11 insertions(+), 4 deletions(-)
diff -puN arch/ia64/include/asm/pgtable.h~ia64-ptemaph arch/ia64/include/asm/pgtable.h
--- linux-2.6.git/arch/ia64/include/asm/pgtable.h~ia64-ptemaph 2009-04-30 15:10:57.000000000 -0700
+++ linux-2.6.git-dave/arch/ia64/include/asm/pgtable.h 2009-04-30 15:10:57.000000000 -0700
@@ -405,10 +405,8 @@ pgd_offset (const struct mm_struct *mm,
*/
#define pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir,addr) ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr))
-#define pte_offset_map(dir,addr) pte_offset_kernel(dir, addr)
-#define pte_offset_map_nested(dir,addr) pte_offset_map(dir, addr)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+
+#include <asm/ptemap.h>
/* atomic versions of the some PTE manipulations: */
diff -puN arch/ia64/include/asm/ptemap.h~ia64-ptemaph arch/ia64/include/asm/ptemap.h
--- linux-2.6.git/arch/ia64/include/asm/ptemap.h~ia64-ptemaph 2009-04-30 15:10:57.000000000 -0700
+++ linux-2.6.git-dave/arch/ia64/include/asm/ptemap.h 2009-04-30 15:10:57.000000000 -0700
@@ -0,0 +1,9 @@
+#ifndef _IA64_ASM_PTEMAP_H
+#define _IA64_ASM_PTEMAP_H
+
+#define pte_offset_map(dir,addr) pte_offset_kernel(dir, addr)
+#define pte_offset_map_nested(dir,addr) pte_offset_map(dir, addr)
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _IA64_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 09/35] m32r: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (7 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 08/35] ia64: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 10/35] m68k: " Dave Hansen
` (25 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/m32r/include/asm/pgtable.h | 6 +-----
linux-2.6.git-dave/arch/m32r/include/asm/ptemap.h | 10 ++++++++++
2 files changed, 11 insertions(+), 5 deletions(-)
diff -puN arch/m32r/include/asm/pgtable.h~m32r-ptemaph arch/m32r/include/asm/pgtable.h
--- linux-2.6.git/arch/m32r/include/asm/pgtable.h~m32r-ptemaph 2009-04-30 15:10:57.000000000 -0700
+++ linux-2.6.git-dave/arch/m32r/include/asm/pgtable.h 2009-04-30 15:10:57.000000000 -0700
@@ -330,11 +330,7 @@ static inline void pmd_set(pmd_t * pmdp,
(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, address) \
((pte_t *)pmd_page_vaddr(*(dir)) + pte_index(address))
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
-#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+#include <asm/ptemap.h>
/* Encode and de-code a swap entry */
#define __swp_type(x) (((x).val >> 2) & 0x1f)
diff -puN arch/m32r/include/asm/ptemap.h~m32r-ptemaph arch/m32r/include/asm/ptemap.h
--- linux-2.6.git/arch/m32r/include/asm/ptemap.h~m32r-ptemaph 2009-04-30 15:10:57.000000000 -0700
+++ linux-2.6.git-dave/arch/m32r/include/asm/ptemap.h 2009-04-30 15:10:57.000000000 -0700
@@ -0,0 +1,10 @@
+#ifndef _M32R_ASM_PTEMAP_H
+#define _M32R_ASM_PTEMAP_H
+
+#define pte_offset_map(dir, address) \
+ ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
+#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _M32R_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 10/35] m68k: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (8 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 09/35] m32r: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 11/35] mips: " Dave Hansen
` (24 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/m68k/include/asm/motorola_pgtable.h | 5 --
linux-2.6.git-dave/arch/m68k/include/asm/ptemap.h | 22 ++++++++++++
linux-2.6.git-dave/arch/m68k/include/asm/sun3_pgtable.h | 6 +--
3 files changed, 25 insertions(+), 8 deletions(-)
diff -puN arch/m68k/include/asm/motorola_pgtable.h~m68k-ptemaph arch/m68k/include/asm/motorola_pgtable.h
--- linux-2.6.git/arch/m68k/include/asm/motorola_pgtable.h~m68k-ptemaph 2009-04-30 15:10:58.000000000 -0700
+++ linux-2.6.git-dave/arch/m68k/include/asm/motorola_pgtable.h 2009-04-30 15:10:58.000000000 -0700
@@ -220,10 +220,7 @@ static inline pte_t *pte_offset_kernel(p
return (pte_t *)__pmd_page(*pmdp) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
}
-#define pte_offset_map(pmdp,address) ((pte_t *)__pmd_page(*pmdp) + (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
-#define pte_offset_map_nested(pmdp, address) pte_offset_map(pmdp, address)
-#define pte_unmap(pte) ((void)0)
-#define pte_unmap_nested(pte) ((void)0)
+#include <asm/ptemap.h>
/*
* Allocate and free page tables. The xxx_kernel() versions are
diff -puN /dev/null arch/m68k/include/asm/ptemap.h
--- /dev/null 2008-09-02 09:40:19.000000000 -0700
+++ linux-2.6.git-dave/arch/m68k/include/asm/ptemap.h 2009-04-30 15:10:58.000000000 -0700
@@ -0,0 +1,22 @@
+#ifndef _M68K_ASM_PTEMAP_H
+#define _M68K_ASM_PTEMAP_H
+
+#ifdef CONFIG_SUN3
+
+#include <linux/mm.h>
+
+#define pte_offset_map(pmd, address) ((pte_t *)kmap(pmd_page(*pmd)) + pte_index(address))
+#define pte_offset_map_nested(pmd, address) pte_offset_map(pmd, address)
+#define pte_unmap(pte) kunmap(pte)
+#define pte_unmap_nested(pte) kunmap(pte)
+
+#else /* !CONFIG_SUN3, Motorola */
+
+#define pte_offset_map(pmdp,address) ((pte_t *)__pmd_page(*pmdp) + (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
+#define pte_offset_map_nested(pmdp, address) pte_offset_map(pmdp, address)
+#define pte_unmap(pte) ((void)0)
+#define pte_unmap_nested(pte) ((void)0)
+
+#endif /* CONFIG_SUN3 */
+
+#endif /* _M68K_ASM_PTEMAP_H */
diff -puN arch/m68k/include/asm/sun3_pgtable.h~m68k-ptemaph arch/m68k/include/asm/sun3_pgtable.h
--- linux-2.6.git/arch/m68k/include/asm/sun3_pgtable.h~m68k-ptemaph 2009-04-30 15:10:58.000000000 -0700
+++ linux-2.6.git-dave/arch/m68k/include/asm/sun3_pgtable.h 2009-04-30 15:10:58.000000000 -0700
@@ -218,10 +218,8 @@ static inline pte_t pgoff_to_pte(unsigne
#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
#define pte_offset_kernel(pmd, address) ((pte_t *) __pmd_page(*pmd) + pte_index(address))
/* FIXME: should we bother with kmap() here? */
-#define pte_offset_map(pmd, address) ((pte_t *)kmap(pmd_page(*pmd)) + pte_index(address))
-#define pte_offset_map_nested(pmd, address) pte_offset_map(pmd, address)
-#define pte_unmap(pte) kunmap(pte)
-#define pte_unmap_nested(pte) kunmap(pte)
+
+#include <asm/ptemap.h>
/* Macros to (de)construct the fake PTEs representing swap pages. */
#define __swp_type(x) ((x).val & 0x7F)
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 11/35] mips: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (9 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 10/35] m68k: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 12/35] mn10300: " Dave Hansen
` (23 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/mips/include/asm/pgtable-32.h | 8 ------
linux-2.6.git-dave/arch/mips/include/asm/pgtable-64.h | 8 ------
linux-2.6.git-dave/arch/mips/include/asm/ptemap.h | 22 ++++++++++++++++++
3 files changed, 24 insertions(+), 14 deletions(-)
diff -puN arch/mips/include/asm/pgtable-32.h~mips-ptemaph arch/mips/include/asm/pgtable-32.h
--- linux-2.6.git/arch/mips/include/asm/pgtable-32.h~mips-ptemaph 2009-04-30 15:10:58.000000000 -0700
+++ linux-2.6.git-dave/arch/mips/include/asm/pgtable-32.h 2009-04-30 15:10:58.000000000 -0700
@@ -151,13 +151,7 @@ pfn_pte(unsigned long pfn, pgprot_t prot
((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
#define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
-
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_offset_map_nested(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_unmap(pte) ((void)(pte))
-#define pte_unmap_nested(pte) ((void)(pte))
+#include <asm/ptemap.h>
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
diff -puN arch/mips/include/asm/pgtable-64.h~mips-ptemaph arch/mips/include/asm/pgtable-64.h
--- linux-2.6.git/arch/mips/include/asm/pgtable-64.h~mips-ptemaph 2009-04-30 15:10:58.000000000 -0700
+++ linux-2.6.git-dave/arch/mips/include/asm/pgtable-64.h 2009-04-30 15:10:58.000000000 -0700
@@ -215,13 +215,7 @@ static inline pmd_t *pmd_offset(pud_t *
((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
#define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_offset_map_nested(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_unmap(pte) ((void)(pte))
-#define pte_unmap_nested(pte) ((void)(pte))
-
+#include <asm/ptemap.h>
/*
* Initialize a new pgd / pmd table with invalid pointers.
*/
diff -puN /dev/null arch/mips/include/asm/ptemap.h
--- /dev/null 2008-09-02 09:40:19.000000000 -0700
+++ linux-2.6.git-dave/arch/mips/include/asm/ptemap.h 2009-04-30 15:10:58.000000000 -0700
@@ -0,0 +1,22 @@
+#ifndef _MIPS_ASM_PTEMAP_H
+#define _MIPS_ASM_PTEMAP_H
+
+#ifdef CONFIG_32BIT
+#define pte_offset_map(dir, address) \
+ ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
+#define pte_offset_map_nested(dir, address) \
+ ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
+#define pte_unmap(pte) ((void)(pte))
+#define pte_unmap_nested(pte) ((void)(pte))
+#endif
+
+#ifdef CONFIG_64BIT
+#define pte_offset_map(dir, address) \
+ ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
+#define pte_offset_map_nested(dir, address) \
+ ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
+#define pte_unmap(pte) ((void)(pte))
+#define pte_unmap_nested(pte) ((void)(pte))
+#endif
+
+#endif /* _MIPS_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 12/35] mn10300: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (10 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 11/35] mips: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 13/35] parisc: " Dave Hansen
` (22 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/mn10300/include/asm/pgtable.h | 6 +-----
linux-2.6.git-dave/arch/mn10300/include/asm/ptemap.h | 10 ++++++++++
2 files changed, 11 insertions(+), 5 deletions(-)
diff -puN arch/mn10300/include/asm/pgtable.h~mn10300-ptemaph arch/mn10300/include/asm/pgtable.h
--- linux-2.6.git/arch/mn10300/include/asm/pgtable.h~mn10300-ptemaph 2009-04-30 15:10:59.000000000 -0700
+++ linux-2.6.git-dave/arch/mn10300/include/asm/pgtable.h 2009-04-30 15:10:59.000000000 -0700
@@ -455,11 +455,7 @@ static inline int set_kernel_exec(unsign
return 0;
}
-#define pte_offset_map(dir, address) \
- ((pte_t *) page_address(pmd_page(*(dir))) + pte_index(address))
-#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
-#define pte_unmap(pte) do {} while (0)
-#define pte_unmap_nested(pte) do {} while (0)
+#include <asm/ptemap.h>
/*
* The MN10300 has external MMU info in the form of a TLB: this is adapted from
diff -puN arch/mn10300/include/asm/ptemap.h~mn10300-ptemaph arch/mn10300/include/asm/ptemap.h
--- linux-2.6.git/arch/mn10300/include/asm/ptemap.h~mn10300-ptemaph 2009-04-30 15:10:59.000000000 -0700
+++ linux-2.6.git-dave/arch/mn10300/include/asm/ptemap.h 2009-04-30 15:10:59.000000000 -0700
@@ -0,0 +1,10 @@
+#ifndef _MN10300_ASM_PTEMAP_H
+#define _MN10300_ASM_PTEMAP_H
+
+#define pte_offset_map(dir, address) \
+ ((pte_t *) page_address(pmd_page(*(dir))) + pte_index(address))
+#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
+#define pte_unmap(pte) do {} while (0)
+#define pte_unmap_nested(pte) do {} while (0)
+
+#endif /* _MN10300_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 13/35] parisc: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (11 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 12/35] mn10300: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-02 14:29 ` Kyle McMartin
2009-05-01 14:42 ` [RFC][PATCH 14/35] powerpc: " Dave Hansen
` (21 subsequent siblings)
34 siblings, 1 reply; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/parisc/include/asm/pgtable.h | 7 +------
linux-2.6.git-dave/arch/parisc/include/asm/ptemap.h | 12 ++++++++++++
2 files changed, 13 insertions(+), 6 deletions(-)
diff -puN arch/parisc/include/asm/pgtable.h~parisc-ptemaph arch/parisc/include/asm/pgtable.h
--- linux-2.6.git/arch/parisc/include/asm/pgtable.h~parisc-ptemaph 2009-04-30 15:10:59.000000000 -0700
+++ linux-2.6.git-dave/arch/parisc/include/asm/pgtable.h 2009-04-30 15:10:59.000000000 -0700
@@ -396,13 +396,8 @@ static inline pte_t pte_modify(pte_t pte
#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
#define pte_offset_kernel(pmd, address) \
((pte_t *) pmd_page_vaddr(*(pmd)) + pte_index(address))
-#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
-#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+#include <asm/ptemap.h>
extern void paging_init (void);
diff -puN arch/parisc/include/asm/ptemap.h~parisc-ptemaph arch/parisc/include/asm/ptemap.h
--- linux-2.6.git/arch/parisc/include/asm/ptemap.h~parisc-ptemaph 2009-04-30 15:10:59.000000000 -0700
+++ linux-2.6.git-dave/arch/parisc/include/asm/ptemap.h 2009-04-30 15:10:59.000000000 -0700
@@ -0,0 +1,12 @@
+#ifndef _PARISC_ASM_PTEMAP_H
+#define _PARISC_ASM_PTEMAP_H
+
+#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
+#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _PARISC_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 14/35] powerpc: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (12 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 13/35] parisc: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 15/35] s390: " Dave Hansen
` (20 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/powerpc/include/asm/pgtable-ppc32.h | 8 ----
linux-2.6.git-dave/arch/powerpc/include/asm/pgtable-ppc64.h | 5 --
linux-2.6.git-dave/arch/powerpc/include/asm/ptemap.h | 23 ++++++++++++
3 files changed, 24 insertions(+), 12 deletions(-)
diff -puN arch/powerpc/include/asm/pgtable-ppc32.h~powerpc-ptemaph arch/powerpc/include/asm/pgtable-ppc32.h
--- linux-2.6.git/arch/powerpc/include/asm/pgtable-ppc32.h~powerpc-ptemaph 2009-04-30 15:11:00.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/include/asm/pgtable-ppc32.h 2009-04-30 15:11:00.000000000 -0700
@@ -284,14 +284,6 @@ static inline void __ptep_set_access_fla
(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, addr) \
((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr))
-#define pte_offset_map(dir, addr) \
- ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE0) + pte_index(addr))
-#define pte_offset_map_nested(dir, addr) \
- ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE1) + pte_index(addr))
-
-#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
-#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
-
/*
* Encode and decode a swap entry.
* Note that the bits we use in a PTE for representing a swap entry
diff -puN arch/powerpc/include/asm/pgtable-ppc64.h~powerpc-ptemaph arch/powerpc/include/asm/pgtable-ppc64.h
--- linux-2.6.git/arch/powerpc/include/asm/pgtable-ppc64.h~powerpc-ptemaph 2009-04-30 15:11:00.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/include/asm/pgtable-ppc64.h 2009-04-30 15:11:00.000000000 -0700
@@ -162,10 +162,7 @@
#define pte_offset_kernel(dir,addr) \
(((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
-#define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr))
-#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr))
-#define pte_unmap(pte) do { } while(0)
-#define pte_unmap_nested(pte) do { } while(0)
+#include <asm/ptemap.h>
/* to find an entry in a kernel page-table-directory */
/* This now only contains the vmalloc pages */
diff -puN /dev/null arch/powerpc/include/asm/ptemap.h
--- /dev/null 2008-09-02 09:40:19.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/include/asm/ptemap.h 2009-04-30 15:11:00.000000000 -0700
@@ -0,0 +1,23 @@
+#ifndef _POWERPC_ASM_PTEMAP_H
+#define _POWERPC_ASM_PTEMAP_H
+
+#ifndef __powerpc64__
+
+#define pte_offset_map(dir, addr) \
+ ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE0) + pte_index(addr))
+#define pte_offset_map_nested(dir, addr) \
+ ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE1) + pte_index(addr))
+
+#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
+#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
+
+#else /* __powerpc64__ */
+
+#define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr))
+#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr))
+#define pte_unmap(pte) do { } while(0)
+#define pte_unmap_nested(pte) do { } while(0)
+
+#endif
+
+#endif /* _POWERPC_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 15/35] s390: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (13 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 14/35] powerpc: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 16/35] sh: " Dave Hansen
` (19 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/s390/include/asm/pgtable.h | 6 ++----
linux-2.6.git-dave/arch/s390/include/asm/ptemap.h | 9 +++++++++
2 files changed, 11 insertions(+), 4 deletions(-)
diff -puN arch/s390/include/asm/pgtable.h~s390-ptemaph arch/s390/include/asm/pgtable.h
--- linux-2.6.git/arch/s390/include/asm/pgtable.h~s390-ptemaph 2009-04-30 15:11:01.000000000 -0700
+++ linux-2.6.git-dave/arch/s390/include/asm/pgtable.h 2009-04-30 15:11:01.000000000 -0700
@@ -1040,10 +1040,8 @@ static inline pmd_t *pmd_offset(pud_t *p
/* Find an entry in the lowest level page table.. */
#define pte_offset(pmd, addr) ((pte_t *) pmd_deref(*(pmd)) + pte_index(addr))
#define pte_offset_kernel(pmd, address) pte_offset(pmd,address)
-#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
-#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+
+#include <asm/ptemap.h>
/*
* 31 bit swap entry format:
diff -puN arch/s390/include/asm/ptemap.h~s390-ptemaph arch/s390/include/asm/ptemap.h
--- linux-2.6.git/arch/s390/include/asm/ptemap.h~s390-ptemaph 2009-04-30 15:11:01.000000000 -0700
+++ linux-2.6.git-dave/arch/s390/include/asm/ptemap.h 2009-04-30 15:11:01.000000000 -0700
@@ -0,0 +1,9 @@
+#ifndef _S390_ASM_PTEMAP_H
+#define _S390_ASM_PTEMAP_H
+
+#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
+#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _S390_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 16/35] sh: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (14 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 15/35] s390: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 17/35] sparc: " Dave Hansen
` (18 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/sh/include/asm/pgtable_32.h | 6 +-----
linux-2.6.git-dave/arch/sh/include/asm/pgtable_64.h | 5 +----
linux-2.6.git-dave/arch/sh/include/asm/ptemap.h | 9 +++++++++
3 files changed, 11 insertions(+), 9 deletions(-)
diff -puN arch/sh/include/asm/pgtable_32.h~sh-ptemaph arch/sh/include/asm/pgtable_32.h
--- linux-2.6.git/arch/sh/include/asm/pgtable_32.h~sh-ptemaph 2009-04-30 15:11:01.000000000 -0700
+++ linux-2.6.git-dave/arch/sh/include/asm/pgtable_32.h 2009-04-30 15:11:01.000000000 -0700
@@ -403,11 +403,7 @@ static inline pte_t pte_modify(pte_t pte
#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
-#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
-#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
-
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+#include <asm/ptemap.h>
#ifdef CONFIG_X2TLB
#define pte_ERROR(e) \
diff -puN arch/sh/include/asm/pgtable_64.h~sh-ptemaph arch/sh/include/asm/pgtable_64.h
--- linux-2.6.git/arch/sh/include/asm/pgtable_64.h~sh-ptemaph 2009-04-30 15:11:01.000000000 -0700
+++ linux-2.6.git-dave/arch/sh/include/asm/pgtable_64.h 2009-04-30 15:11:01.000000000 -0700
@@ -83,10 +83,7 @@ static __inline__ void pmd_set(pmd_t *pm
#define pte_offset_kernel(dir, addr) \
((pte_t *) ((pmd_val(*(dir))) & PAGE_MASK) + pte_index((addr)))
-#define pte_offset_map(dir,addr) pte_offset_kernel(dir, addr)
-#define pte_offset_map_nested(dir,addr) pte_offset_kernel(dir, addr)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+#include <asm/ptemap.h>
#ifndef __ASSEMBLY__
#define IOBASE_VADDR 0xff000000
diff -puN /dev/null arch/sh/include/asm/ptemap.h
--- /dev/null 2008-09-02 09:40:19.000000000 -0700
+++ linux-2.6.git-dave/arch/sh/include/asm/ptemap.h 2009-04-30 15:11:01.000000000 -0700
@@ -0,0 +1,9 @@
+#ifndef _SH_ASM_PTEMAP_H
+#define _SH_ASM_PTEMAP_H
+
+#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
+#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _SH_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 17/35] sparc: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (15 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 16/35] sh: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-02 7:02 ` Daniel K.
2009-05-01 14:42 ` [RFC][PATCH 18/35] um: " Dave Hansen
` (17 subsequent siblings)
34 siblings, 1 reply; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/sparc/include/asm/pgtable_32.h | 15 --------
linux-2.6.git-dave/arch/sparc/include/asm/pgtable_64.h | 5 --
linux-2.6.git-dave/arch/sparc/include/asm/ptemap.h | 29 +++++++++++++++++
3 files changed, 31 insertions(+), 18 deletions(-)
diff -puN arch/sparc/include/asm/pgtable_32.h~sparc-ptemaph arch/sparc/include/asm/pgtable_32.h
--- linux-2.6.git/arch/sparc/include/asm/pgtable_32.h~sparc-ptemaph 2009-04-30 15:11:02.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/include/asm/pgtable_32.h 2009-04-30 15:11:02.000000000 -0700
@@ -300,20 +300,7 @@ BTFIXUPDEF_CALL(pmd_t *, pmd_offset, pgd
BTFIXUPDEF_CALL(pte_t *, pte_offset_kernel, pmd_t *, unsigned long)
#define pte_offset_kernel(dir,addr) BTFIXUP_CALL(pte_offset_kernel)(dir,addr)
-/*
- * This shortcut works on sun4m (and sun4d) because the nocache area is static,
- * and sun4c is guaranteed to have no highmem anyway.
- */
-#define pte_offset_map(d, a) pte_offset_kernel(d,a)
-#define pte_offset_map_nested(d, a) pte_offset_kernel(d,a)
-
-#define pte_unmap(pte) do{}while(0)
-#define pte_unmap_nested(pte) do{}while(0)
-
-/* Certain architectures need to do special things when pte's
- * within a page table are directly modified. Thus, the following
- * hook is made available.
- */
+#include <asm/ptemap.h>
BTFIXUPDEF_CALL(void, set_pte, pte_t *, pte_t)
diff -puN arch/sparc/include/asm/pgtable_64.h~sparc-ptemaph arch/sparc/include/asm/pgtable_64.h
--- linux-2.6.git/arch/sparc/include/asm/pgtable_64.h~sparc-ptemaph 2009-04-30 15:11:02.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/include/asm/pgtable_64.h 2009-04-30 15:11:02.000000000 -0700
@@ -652,10 +652,7 @@ static inline int pte_special(pte_t pte)
/* Find an entry in the third-level page table.. */
#define pte_offset_kernel(dir, address) \
((pte_t *)pmd_page_vaddr(*(dir)) + pte_index(address))
-#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
-#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+#include <asm/ptemap.h>
/* Actual page table PTE updates. */
extern void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t orig);
diff -puN /dev/null arch/sparc/include/asm/ptemap.h
--- /dev/null 2008-09-02 09:40:19.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/include/asm/ptemap.h 2009-04-30 15:11:02.000000000 -0700
@@ -0,0 +1,29 @@
+#ifndef _SPARC_ASM_PTEMAP_H
+#define _SPARC_ASM_PTEMAP_H
+
+#if defined(__sparc__) && defined(__arch64__)
+
+/* Certain architectures need to do special things when pte's
+ * within a page table are directly modified. Thus, the following
+ * hook is made available.
+ */
+
+#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
+#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#else
+
+ * This shortcut works on sun4m (and sun4d) because the nocache area is static,
+ * and sun4c is guaranteed to have no highmem anyway.
+ */
+#define pte_offset_map(d, a) pte_offset_kernel(d,a)
+#define pte_offset_map_nested(d, a) pte_offset_kernel(d,a)
+
+#define pte_unmap(pte) do{}while(0)
+#define pte_unmap_nested(pte) do{}while(0)
+
+#endif
+
+#endif /* _SPARC_ASM_PTEMAP_H *//*
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 18/35] um: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (16 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 17/35] sparc: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 19/35] x86: " Dave Hansen
` (16 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/um/include/asm/pgtable.h | 7 +------
linux-2.6.git-dave/arch/um/include/asm/ptemap.h | 10 ++++++++++
2 files changed, 11 insertions(+), 6 deletions(-)
diff -puN arch/um/include/asm/pgtable.h~um-ptemaph arch/um/include/asm/pgtable.h
--- linux-2.6.git/arch/um/include/asm/pgtable.h~um-ptemaph 2009-04-30 15:11:02.000000000 -0700
+++ linux-2.6.git-dave/arch/um/include/asm/pgtable.h 2009-04-30 15:11:02.000000000 -0700
@@ -331,12 +331,7 @@ static inline pte_t pte_modify(pte_t pte
#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
-#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
+#include <asm/ptemap.h>
struct mm_struct;
extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
diff -puN arch/um/include/asm/ptemap.h~um-ptemaph arch/um/include/asm/ptemap.h
--- linux-2.6.git/arch/um/include/asm/ptemap.h~um-ptemaph 2009-04-30 15:11:02.000000000 -0700
+++ linux-2.6.git-dave/arch/um/include/asm/ptemap.h 2009-04-30 15:11:02.000000000 -0700
@@ -0,0 +1,10 @@
+#ifndef _UM_ASM_PTEMAP_H
+#define _UM_ASM_PTEMAP_H
+
+#define pte_offset_map(dir, address) \
+ ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
+#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _UM_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 19/35] x86: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (17 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 18/35] um: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 20/35] xtensa: " Dave Hansen
` (15 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/x86/include/asm/pgtable_32.h | 17 ---------
linux-2.6.git-dave/arch/x86/include/asm/pgtable_64.h | 6 ---
linux-2.6.git-dave/arch/x86/include/asm/ptemap.h | 34 +++++++++++++++++++
3 files changed, 36 insertions(+), 21 deletions(-)
diff -puN arch/x86/include/asm/pgtable_32.h~x86-ptemaph arch/x86/include/asm/pgtable_32.h
--- linux-2.6.git/arch/x86/include/asm/pgtable_32.h~x86-ptemaph 2009-04-30 15:11:03.000000000 -0700
+++ linux-2.6.git-dave/arch/x86/include/asm/pgtable_32.h 2009-04-30 15:11:03.000000000 -0700
@@ -48,22 +48,7 @@ extern void set_pmd_pfn(unsigned long, u
# include <asm/pgtable-2level.h>
#endif
-#if defined(CONFIG_HIGHPTE)
-#define pte_offset_map(dir, address) \
- ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE0) + \
- pte_index((address)))
-#define pte_offset_map_nested(dir, address) \
- ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE1) + \
- pte_index((address)))
-#define pte_unmap(pte) kunmap_atomic((pte), KM_PTE0)
-#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
-#else
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + pte_index((address)))
-#define pte_offset_map_nested(dir, address) pte_offset_map((dir), (address))
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-#endif
+#include <asm/ptemap.h>
/* Clear a kernel PTE and flush it from the TLB */
#define kpte_clear_flush(ptep, vaddr) \
diff -puN arch/x86/include/asm/pgtable_64.h~x86-ptemaph arch/x86/include/asm/pgtable_64.h
--- linux-2.6.git/arch/x86/include/asm/pgtable_64.h~x86-ptemaph 2009-04-30 15:11:03.000000000 -0700
+++ linux-2.6.git-dave/arch/x86/include/asm/pgtable_64.h 2009-04-30 15:11:03.000000000 -0700
@@ -127,11 +127,7 @@ static inline int pgd_large(pgd_t pgd) {
/* PTE - Level 1 access. */
-/* x86-64 always has all page tables mapped. */
-#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
-#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
-#define pte_unmap(pte) /* NOP */
-#define pte_unmap_nested(pte) /* NOP */
+#include <asm/ptemap.h>
#define update_mmu_cache(vma, address, pte) do { } while (0)
diff -puN /dev/null arch/x86/include/asm/ptemap.h
--- /dev/null 2008-09-02 09:40:19.000000000 -0700
+++ linux-2.6.git-dave/arch/x86/include/asm/ptemap.h 2009-04-30 15:11:03.000000000 -0700
@@ -0,0 +1,34 @@
+#ifndef _X86_ASM_PTEMAP_H
+#define _X86_ASM_PTEMAP_H
+
+#ifdef CONFIG_X86_32
+
+#if defined(CONFIG_HIGHPTE)
+
+#define pte_offset_map(dir, address) \
+ ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE0) + \
+ pte_index((address)))
+#define pte_offset_map_nested(dir, address) \
+ ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE1) + \
+ pte_index((address)))
+#define pte_unmap(pte) kunmap_atomic((pte), KM_PTE0)
+#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
+#else
+#define pte_offset_map(dir, address) \
+ ((pte_t *)page_address(pmd_page(*(dir))) + pte_index((address)))
+#define pte_offset_map_nested(dir, address) pte_offset_map((dir), (address))
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+#endif
+
+#else /* x86-64 */
+
+/* x86-64 always has all page tables mapped. */
+#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
+#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
+#define pte_unmap(pte) /* NOP */
+#define pte_unmap_nested(pte) /* NOP */
+
+#endif
+
+#endif /* _X86_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 20/35] xtensa: create ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (18 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 19/35] x86: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 21/35] create linux/ptemap.h for arch-independent pte mapping funcs Dave Hansen
` (14 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/xtensa/include/asm/pgtable.h | 6 ------
linux-2.6.git-dave/arch/xtensa/include/asm/ptemap.h | 10 ++++++++++
2 files changed, 10 insertions(+), 6 deletions(-)
diff -puN arch/xtensa/include/asm/pgtable.h~xtensa-ptemaph arch/xtensa/include/asm/pgtable.h
--- linux-2.6.git/arch/xtensa/include/asm/pgtable.h~xtensa-ptemaph 2009-04-30 15:11:04.000000000 -0700
+++ linux-2.6.git-dave/arch/xtensa/include/asm/pgtable.h 2009-04-30 15:11:04.000000000 -0700
@@ -323,12 +323,6 @@ ptep_set_wrprotect(struct mm_struct *mm,
#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir,addr) \
((pte_t*) pmd_page_vaddr(*(dir)) + pte_index(addr))
-#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
-#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
-
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
/*
* Encode and decode a swap entry.
diff -puN /dev/null arch/xtensa/include/asm/ptemap.h
--- /dev/null 2008-09-02 09:40:19.000000000 -0700
+++ linux-2.6.git-dave/arch/xtensa/include/asm/ptemap.h 2009-04-30 15:11:04.000000000 -0700
@@ -0,0 +1,10 @@
+#ifndef _XTENSA_ASM_PTEMAP_H
+#define _XTENSA_ASM_PTEMAP_H
+
+#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
+#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
+
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _XTENSA_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 21/35] create linux/ptemap.h for arch-independent pte mapping funcs
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (19 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 20/35] xtensa: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 22/35] include linux/ptemap.h at all use sites Dave Hansen
` (13 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
linux/mm.h has a couple of completely arch-independent
pte mapping functions. Let's move them to their own header
to help separate out their dependencies from the rest of
mm.h.
I'll get the callsites in the next patch. For now, just
include the new header where its functions used to be.
I'll remove this in the next patch.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/include/linux/mm.h | 26 ----------------------
linux-2.6.git-dave/include/linux/ptemap.h | 34 ++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 26 deletions(-)
diff -puN include/linux/mm.h~linux-ptemap-h include/linux/mm.h
--- linux-2.6.git/include/linux/mm.h~linux-ptemap-h 2009-04-30 15:11:04.000000000 -0700
+++ linux-2.6.git-dave/include/linux/mm.h 2009-04-30 15:11:04.000000000 -0700
@@ -969,32 +969,6 @@ static inline void pgtable_page_dtor(str
dec_zone_page_state(page, NR_PAGETABLE);
}
-#define pte_offset_map_lock(mm, pmd, address, ptlp) \
-({ \
- spinlock_t *__ptl = pte_lockptr(mm, pmd); \
- pte_t *__pte = pte_offset_map(pmd, address); \
- *(ptlp) = __ptl; \
- spin_lock(__ptl); \
- __pte; \
-})
-
-#define pte_unmap_unlock(pte, ptl) do { \
- spin_unlock(ptl); \
- pte_unmap(pte); \
-} while (0)
-
-#define pte_alloc_map(mm, pmd, address) \
- ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
- NULL: pte_offset_map(pmd, address))
-
-#define pte_alloc_map_lock(mm, pmd, address, ptlp) \
- ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
- NULL: pte_offset_map_lock(mm, pmd, address, ptlp))
-
-#define pte_alloc_kernel(pmd, address) \
- ((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \
- NULL: pte_offset_kernel(pmd, address))
-
extern void free_area_init(unsigned long * zones_size);
extern void free_area_init_node(int nid, unsigned long * zones_size,
unsigned long zone_start_pfn, unsigned long *zholes_size);
diff -puN include/linux/ptemap.h~linux-ptemap-h include/linux/ptemap.h
--- linux-2.6.git/include/linux/ptemap.h~linux-ptemap-h 2009-04-30 15:11:04.000000000 -0700
+++ linux-2.6.git-dave/include/linux/ptemap.h 2009-04-30 15:11:04.000000000 -0700
@@ -0,0 +1,34 @@
+#ifndef _LINUX_PTE_MAP_H
+#define _LINUX_PTE_MAP_H
+
+#include <linux/mm.h>
+#include <asm/ptemap.h>
+
+#define pte_offset_map_lock(mm, pmd, address, ptlp) \
+({ \
+ spinlock_t *__ptl = pte_lockptr(mm, pmd); \
+ pte_t *__pte = pte_offset_map(pmd, address); \
+ *(ptlp) = __ptl; \
+ spin_lock(__ptl); \
+ __pte; \
+})
+
+#define pte_unmap_unlock(pte, ptl) do { \
+ spin_unlock(ptl); \
+ pte_unmap(pte); \
+} while (0)
+
+#define pte_alloc_map(mm, pmd, address) \
+ ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
+ NULL: pte_offset_map(pmd, address))
+
+#define pte_alloc_map_lock(mm, pmd, address, ptlp) \
+ ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
+ NULL: pte_offset_map_lock(mm, pmd, address, ptlp))
+
+#define pte_alloc_kernel(pmd, address) \
+ ((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \
+ NULL: pte_offset_kernel(pmd, address))
+
+
+#endif /* _LINUX_PTE_MAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 22/35] include linux/ptemap.h at all use sites
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (20 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 21/35] create linux/ptemap.h for arch-independent pte mapping funcs Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 23/35] factor x86 pte mapping code Dave Hansen
` (12 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
DESC
ptemaph-compile-fix-2
EDESC
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/arm/kernel/traps.c | 1 +
linux-2.6.git-dave/arch/arm/mm/fault-armv.c | 1 +
linux-2.6.git-dave/arch/arm/mm/fault.c | 1 +
linux-2.6.git-dave/arch/arm/mm/pgd.c | 1 +
linux-2.6.git-dave/arch/ia64/mm/hugetlbpage.c | 1 +
linux-2.6.git-dave/arch/m68k/mm/kmap.c | 1 +
linux-2.6.git-dave/arch/mips/mm/tlb-r4k.c | 1 +
linux-2.6.git-dave/arch/mips/mm/tlb-r8k.c | 1 +
linux-2.6.git-dave/arch/mn10300/mm/cache.c | 1 +
linux-2.6.git-dave/arch/parisc/kernel/cache.c | 1 +
linux-2.6.git-dave/arch/parisc/kernel/pci-dma.c | 2 ++
linux-2.6.git-dave/arch/powerpc/mm/pgtable_32.c | 1 +
linux-2.6.git-dave/arch/powerpc/mm/pgtable_64.c | 1 +
linux-2.6.git-dave/arch/powerpc/mm/subpage-prot.c | 1 +
linux-2.6.git-dave/arch/s390/lib/uaccess_pt.c | 1 +
linux-2.6.git-dave/arch/sh/mm/cache-sh5.c | 1 +
linux-2.6.git-dave/arch/sh/mm/hugetlbpage.c | 1 +
linux-2.6.git-dave/arch/sparc/kernel/signal32.c | 1 +
linux-2.6.git-dave/arch/sparc/mm/fault_64.c | 1 +
linux-2.6.git-dave/arch/sparc/mm/generic_64.c | 1 +
linux-2.6.git-dave/arch/sparc/mm/hugetlbpage.c | 1 +
linux-2.6.git-dave/arch/sparc/mm/io-unit.c | 1 +
linux-2.6.git-dave/arch/sparc/mm/iommu.c | 1 +
linux-2.6.git-dave/arch/um/kernel/tlb.c | 1 +
linux-2.6.git-dave/arch/x86/kernel/vm86_32.c | 1 +
linux-2.6.git-dave/arch/x86/mm/gup.c | 1 +
linux-2.6.git-dave/fs/proc/task_mmu.c | 1 +
linux-2.6.git-dave/lib/ioremap.c | 1 +
linux-2.6.git-dave/mm/fremap.c | 1 +
linux-2.6.git-dave/mm/memory.c | 1 +
linux-2.6.git-dave/mm/mempolicy.c | 1 +
linux-2.6.git-dave/mm/migrate.c | 1 +
linux-2.6.git-dave/mm/mincore.c | 1 +
linux-2.6.git-dave/mm/mprotect.c | 1 +
linux-2.6.git-dave/mm/mremap.c | 1 +
linux-2.6.git-dave/mm/pagewalk.c | 1 +
linux-2.6.git-dave/mm/rmap.c | 1 +
linux-2.6.git-dave/mm/swapfile.c | 1 +
linux-2.6.git-dave/mm/vmalloc.c | 1 +
39 files changed, 40 insertions(+)
diff -puN arch/arm/kernel/traps.c~include-linux-ptemaph-at-all-call-sites arch/arm/kernel/traps.c
--- linux-2.6.git/arch/arm/kernel/traps.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/arm/kernel/traps.c 2009-04-30 15:11:05.000000000 -0700
@@ -21,6 +21,7 @@
#include <linux/hardirq.h>
#include <linux/init.h>
#include <linux/uaccess.h>
+#include <linux/ptemap.h>
#include <asm/atomic.h>
#include <asm/cacheflush.h>
diff -puN arch/arm/mm/fault-armv.c~include-linux-ptemaph-at-all-call-sites arch/arm/mm/fault-armv.c
--- linux-2.6.git/arch/arm/mm/fault-armv.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/arm/mm/fault-armv.c 2009-04-30 15:11:05.000000000 -0700
@@ -16,6 +16,7 @@
#include <linux/vmalloc.h>
#include <linux/init.h>
#include <linux/pagemap.h>
+#include <linux/ptemap.h>
#include <asm/bugs.h>
#include <asm/cacheflush.h>
diff -puN arch/arm/mm/fault.c~include-linux-ptemaph-at-all-call-sites arch/arm/mm/fault.c
--- linux-2.6.git/arch/arm/mm/fault.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/arm/mm/fault.c 2009-04-30 15:11:05.000000000 -0700
@@ -16,6 +16,7 @@
#include <linux/kprobes.h>
#include <linux/uaccess.h>
#include <linux/page-flags.h>
+#include <linux/ptemap.h>
#include <asm/system.h>
#include <asm/pgtable.h>
diff -puN arch/arm/mm/pgd.c~include-linux-ptemaph-at-all-call-sites arch/arm/mm/pgd.c
--- linux-2.6.git/arch/arm/mm/pgd.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/arm/mm/pgd.c 2009-04-30 15:11:05.000000000 -0700
@@ -9,6 +9,7 @@
*/
#include <linux/mm.h>
#include <linux/highmem.h>
+#include <linux/ptemap.h>
#include <asm/pgalloc.h>
#include <asm/page.h>
diff -puN arch/ia64/mm/hugetlbpage.c~include-linux-ptemaph-at-all-call-sites arch/ia64/mm/hugetlbpage.c
--- linux-2.6.git/arch/ia64/mm/hugetlbpage.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/ia64/mm/hugetlbpage.c 2009-04-30 15:11:05.000000000 -0700
@@ -17,6 +17,7 @@
#include <linux/slab.h>
#include <linux/sysctl.h>
#include <linux/log2.h>
+#include <linux/ptemap.h>
#include <asm/mman.h>
#include <asm/pgalloc.h>
#include <asm/tlb.h>
diff -puN arch/m68k/mm/kmap.c~include-linux-ptemaph-at-all-call-sites arch/m68k/mm/kmap.c
--- linux-2.6.git/arch/m68k/mm/kmap.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/m68k/mm/kmap.c 2009-04-30 15:11:05.000000000 -0700
@@ -14,6 +14,7 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
+#include <linux/ptemap.h>
#include <asm/setup.h>
#include <asm/segment.h>
diff -puN arch/mips/mm/tlb-r4k.c~include-linux-ptemaph-at-all-call-sites arch/mips/mm/tlb-r4k.c
--- linux-2.6.git/arch/mips/mm/tlb-r4k.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/mips/mm/tlb-r4k.c 2009-04-30 15:11:05.000000000 -0700
@@ -11,6 +11,7 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/mm.h>
+#include <linux/ptemap.h>
#include <asm/cpu.h>
#include <asm/bootinfo.h>
diff -puN arch/mips/mm/tlb-r8k.c~include-linux-ptemaph-at-all-call-sites arch/mips/mm/tlb-r8k.c
--- linux-2.6.git/arch/mips/mm/tlb-r8k.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/mips/mm/tlb-r8k.c 2009-04-30 15:11:05.000000000 -0700
@@ -11,6 +11,7 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/mm.h>
+#include <linux/ptemap.h>
#include <asm/cpu.h>
#include <asm/bootinfo.h>
diff -puN arch/mn10300/mm/cache.c~include-linux-ptemaph-at-all-call-sites arch/mn10300/mm/cache.c
--- linux-2.6.git/arch/mn10300/mm/cache.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/mn10300/mm/cache.c 2009-04-30 15:11:05.000000000 -0700
@@ -12,6 +12,7 @@
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/threads.h>
+#include <linux/ptemap.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/processor.h>
diff -puN arch/parisc/kernel/cache.c~include-linux-ptemaph-at-all-call-sites arch/parisc/kernel/cache.c
--- linux-2.6.git/arch/parisc/kernel/cache.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/parisc/kernel/cache.c 2009-04-30 15:11:05.000000000 -0700
@@ -19,6 +19,7 @@
#include <linux/seq_file.h>
#include <linux/pagemap.h>
#include <linux/sched.h>
+#include <linux/ptemap.h>
#include <asm/pdc.h>
#include <asm/cache.h>
#include <asm/cacheflush.h>
diff -puN arch/parisc/kernel/pci-dma.c~include-linux-ptemaph-at-all-call-sites arch/parisc/kernel/pci-dma.c
--- linux-2.6.git/arch/parisc/kernel/pci-dma.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/parisc/kernel/pci-dma.c 2009-04-30 15:11:05.000000000 -0700
@@ -21,11 +21,13 @@
#include <linux/mm.h>
#include <linux/pci.h>
#include <linux/proc_fs.h>
+#include <linux/ptemap.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/scatterlist.h>
+#include <linux/ptemap.h>
#include <asm/cacheflush.h>
#include <asm/dma.h> /* for DMA_CHUNK_SIZE */
diff -puN arch/powerpc/mm/pgtable_32.c~include-linux-ptemaph-at-all-call-sites arch/powerpc/mm/pgtable_32.c
--- linux-2.6.git/arch/powerpc/mm/pgtable_32.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/mm/pgtable_32.c 2009-04-30 15:11:05.000000000 -0700
@@ -26,6 +26,7 @@
#include <linux/vmalloc.h>
#include <linux/init.h>
#include <linux/highmem.h>
+#include <linux/ptemap.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
diff -puN arch/powerpc/mm/pgtable_64.c~include-linux-ptemaph-at-all-call-sites arch/powerpc/mm/pgtable_64.c
--- linux-2.6.git/arch/powerpc/mm/pgtable_64.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/mm/pgtable_64.c 2009-04-30 15:11:05.000000000 -0700
@@ -33,6 +33,7 @@
#include <linux/stddef.h>
#include <linux/vmalloc.h>
#include <linux/init.h>
+#include <linux/ptemap.h>
#include <asm/pgalloc.h>
#include <asm/page.h>
diff -puN arch/powerpc/mm/subpage-prot.c~include-linux-ptemaph-at-all-call-sites arch/powerpc/mm/subpage-prot.c
--- linux-2.6.git/arch/powerpc/mm/subpage-prot.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/mm/subpage-prot.c 2009-04-30 15:11:05.000000000 -0700
@@ -14,6 +14,7 @@
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/hugetlb.h>
+#include <linux/ptemap.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
diff -puN arch/s390/lib/uaccess_pt.c~include-linux-ptemaph-at-all-call-sites arch/s390/lib/uaccess_pt.c
--- linux-2.6.git/arch/s390/lib/uaccess_pt.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/s390/lib/uaccess_pt.c 2009-04-30 15:11:05.000000000 -0700
@@ -11,6 +11,7 @@
#include <linux/errno.h>
#include <linux/hardirq.h>
#include <linux/mm.h>
+#include <linux/ptemap.h>
#include <asm/uaccess.h>
#include <asm/futex.h>
#include "uaccess.h"
diff -puN arch/sh/mm/cache-sh5.c~include-linux-ptemaph-at-all-call-sites arch/sh/mm/cache-sh5.c
--- linux-2.6.git/arch/sh/mm/cache-sh5.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/sh/mm/cache-sh5.c 2009-04-30 15:11:05.000000000 -0700
@@ -13,6 +13,7 @@
#include <linux/init.h>
#include <linux/mman.h>
#include <linux/mm.h>
+#include <linux/ptemap.h>
#include <asm/tlb.h>
#include <asm/processor.h>
#include <asm/cache.h>
diff -puN arch/sh/mm/hugetlbpage.c~include-linux-ptemaph-at-all-call-sites arch/sh/mm/hugetlbpage.c
--- linux-2.6.git/arch/sh/mm/hugetlbpage.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/sh/mm/hugetlbpage.c 2009-04-30 15:11:05.000000000 -0700
@@ -15,6 +15,7 @@
#include <linux/pagemap.h>
#include <linux/slab.h>
#include <linux/sysctl.h>
+#include <linux/ptemap.h>
#include <asm/mman.h>
#include <asm/pgalloc.h>
diff -puN arch/sparc/kernel/signal32.c~include-linux-ptemaph-at-all-call-sites arch/sparc/kernel/signal32.c
--- linux-2.6.git/arch/sparc/kernel/signal32.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/kernel/signal32.c 2009-04-30 15:11:05.000000000 -0700
@@ -20,6 +20,7 @@
#include <linux/compat.h>
#include <linux/bitops.h>
#include <linux/tracehook.h>
+#include <linux/ptemap.h>
#include <asm/uaccess.h>
#include <asm/ptrace.h>
diff -puN arch/sparc/mm/fault_64.c~include-linux-ptemaph-at-all-call-sites arch/sparc/mm/fault_64.c
--- linux-2.6.git/arch/sparc/mm/fault_64.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/mm/fault_64.c 2009-04-30 15:11:05.000000000 -0700
@@ -20,6 +20,7 @@
#include <linux/kprobes.h>
#include <linux/kdebug.h>
#include <linux/percpu.h>
+#include <linux/ptemap.h>
#include <asm/page.h>
#include <asm/pgtable.h>
diff -puN arch/sparc/mm/generic_64.c~include-linux-ptemaph-at-all-call-sites arch/sparc/mm/generic_64.c
--- linux-2.6.git/arch/sparc/mm/generic_64.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/mm/generic_64.c 2009-04-30 15:11:05.000000000 -0700
@@ -9,6 +9,7 @@
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/pagemap.h>
+#include <linux/ptemap.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
diff -puN arch/sparc/mm/hugetlbpage.c~include-linux-ptemaph-at-all-call-sites arch/sparc/mm/hugetlbpage.c
--- linux-2.6.git/arch/sparc/mm/hugetlbpage.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/mm/hugetlbpage.c 2009-04-30 15:11:05.000000000 -0700
@@ -12,6 +12,7 @@
#include <linux/pagemap.h>
#include <linux/slab.h>
#include <linux/sysctl.h>
+#include <linux/ptemap.h>
#include <asm/mman.h>
#include <asm/pgalloc.h>
diff -puN arch/sparc/mm/iommu.c~include-linux-ptemaph-at-all-call-sites arch/sparc/mm/iommu.c
--- linux-2.6.git/arch/sparc/mm/iommu.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/mm/iommu.c 2009-04-30 15:11:05.000000000 -0700
@@ -15,6 +15,7 @@
#include <linux/scatterlist.h>
#include <linux/of.h>
#include <linux/of_device.h>
+#include <linux/ptemap.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
diff -puN arch/sparc/mm/io-unit.c~include-linux-ptemaph-at-all-call-sites arch/sparc/mm/io-unit.c
--- linux-2.6.git/arch/sparc/mm/io-unit.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/mm/io-unit.c 2009-04-30 15:11:05.000000000 -0700
@@ -14,6 +14,7 @@
#include <linux/scatterlist.h>
#include <linux/of.h>
#include <linux/of_device.h>
+#include <linux/ptemap.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
diff -puN arch/um/kernel/tlb.c~include-linux-ptemaph-at-all-call-sites arch/um/kernel/tlb.c
--- linux-2.6.git/arch/um/kernel/tlb.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/um/kernel/tlb.c 2009-04-30 15:11:05.000000000 -0700
@@ -5,6 +5,7 @@
#include <linux/mm.h>
#include <linux/sched.h>
+#include <linux/ptemap.h>
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
#include "as-layout.h"
diff -puN arch/x86/kernel/vm86_32.c~include-linux-ptemaph-at-all-call-sites arch/x86/kernel/vm86_32.c
--- linux-2.6.git/arch/x86/kernel/vm86_32.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/x86/kernel/vm86_32.c 2009-04-30 15:11:05.000000000 -0700
@@ -41,6 +41,7 @@
#include <linux/ptrace.h>
#include <linux/audit.h>
#include <linux/stddef.h>
+#include <linux/ptemap.h>
#include <asm/uaccess.h>
#include <asm/io.h>
diff -puN arch/x86/mm/gup.c~include-linux-ptemaph-at-all-call-sites arch/x86/mm/gup.c
--- linux-2.6.git/arch/x86/mm/gup.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/arch/x86/mm/gup.c 2009-04-30 15:11:05.000000000 -0700
@@ -10,6 +10,7 @@
#include <linux/highmem.h>
#include <asm/pgtable.h>
+#include <asm/ptemap.h>
static inline pte_t gup_get_pte(pte_t *ptep)
{
diff -puN fs/proc/task_mmu.c~include-linux-ptemaph-at-all-call-sites fs/proc/task_mmu.c
--- linux-2.6.git/fs/proc/task_mmu.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/fs/proc/task_mmu.c 2009-04-30 15:11:05.000000000 -0700
@@ -8,6 +8,7 @@
#include <linux/mempolicy.h>
#include <linux/swap.h>
#include <linux/swapops.h>
+#include <linux/ptemap.h>
#include <asm/elf.h>
#include <asm/uaccess.h>
diff -puN lib/ioremap.c~include-linux-ptemaph-at-all-call-sites lib/ioremap.c
--- linux-2.6.git/lib/ioremap.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/lib/ioremap.c 2009-04-30 15:11:05.000000000 -0700
@@ -9,6 +9,7 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/io.h>
+#include <linux/ptemap.h>
#include <asm/cacheflush.h>
#include <asm/pgtable.h>
diff -puN mm/fremap.c~include-linux-ptemaph-at-all-call-sites mm/fremap.c
--- linux-2.6.git/mm/fremap.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/mm/fremap.c 2009-04-30 15:11:05.000000000 -0700
@@ -16,6 +16,7 @@
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/mmu_notifier.h>
+#include <linux/ptemap.h>
#include <asm/mmu_context.h>
#include <asm/cacheflush.h>
diff -puN mm/memory.c~include-linux-ptemaph-at-all-call-sites mm/memory.c
--- linux-2.6.git/mm/memory.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/mm/memory.c 2009-04-30 15:11:05.000000000 -0700
@@ -55,6 +55,7 @@
#include <linux/kallsyms.h>
#include <linux/swapops.h>
#include <linux/elf.h>
+#include <linux/ptemap.h>
#include <asm/pgalloc.h>
#include <asm/uaccess.h>
diff -puN mm/mempolicy.c~include-linux-ptemaph-at-all-call-sites mm/mempolicy.c
--- linux-2.6.git/mm/mempolicy.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/mm/mempolicy.c 2009-04-30 15:11:05.000000000 -0700
@@ -89,6 +89,7 @@
#include <linux/security.h>
#include <linux/syscalls.h>
#include <linux/ctype.h>
+#include <linux/ptemap.h>
#include <asm/tlbflush.h>
#include <asm/uaccess.h>
diff -puN mm/migrate.c~include-linux-ptemaph-at-all-call-sites mm/migrate.c
--- linux-2.6.git/mm/migrate.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/mm/migrate.c 2009-04-30 15:11:05.000000000 -0700
@@ -31,6 +31,7 @@
#include <linux/security.h>
#include <linux/memcontrol.h>
#include <linux/syscalls.h>
+#include <linux/ptemap.h>
#include "internal.h"
diff -puN mm/mincore.c~include-linux-ptemaph-at-all-call-sites mm/mincore.c
--- linux-2.6.git/mm/mincore.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/mm/mincore.c 2009-04-30 15:11:05.000000000 -0700
@@ -14,6 +14,7 @@
#include <linux/syscalls.h>
#include <linux/swap.h>
#include <linux/swapops.h>
+#include <linux/ptemap.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
diff -puN mm/mprotect.c~include-linux-ptemaph-at-all-call-sites mm/mprotect.c
--- linux-2.6.git/mm/mprotect.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/mm/mprotect.c 2009-04-30 15:11:05.000000000 -0700
@@ -23,6 +23,7 @@
#include <linux/swapops.h>
#include <linux/mmu_notifier.h>
#include <linux/migrate.h>
+#include <linux/ptemap.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/cacheflush.h>
diff -puN mm/mremap.c~include-linux-ptemaph-at-all-call-sites mm/mremap.c
--- linux-2.6.git/mm/mremap.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/mm/mremap.c 2009-04-30 15:11:05.000000000 -0700
@@ -19,6 +19,7 @@
#include <linux/security.h>
#include <linux/syscalls.h>
#include <linux/mmu_notifier.h>
+#include <linux/ptemap.h>
#include <asm/uaccess.h>
#include <asm/cacheflush.h>
diff -puN mm/pagewalk.c~include-linux-ptemaph-at-all-call-sites mm/pagewalk.c
--- linux-2.6.git/mm/pagewalk.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/mm/pagewalk.c 2009-04-30 15:11:05.000000000 -0700
@@ -1,6 +1,7 @@
#include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/sched.h>
+#include <linux/ptemap.h>
static int walk_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
struct mm_walk *walk)
diff -puN mm/rmap.c~include-linux-ptemaph-at-all-call-sites mm/rmap.c
--- linux-2.6.git/mm/rmap.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/mm/rmap.c 2009-04-30 15:11:05.000000000 -0700
@@ -50,6 +50,7 @@
#include <linux/memcontrol.h>
#include <linux/mmu_notifier.h>
#include <linux/migrate.h>
+#include <linux/ptemap.h>
#include <asm/tlbflush.h>
diff -puN mm/swapfile.c~include-linux-ptemaph-at-all-call-sites mm/swapfile.c
--- linux-2.6.git/mm/swapfile.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/mm/swapfile.c 2009-04-30 15:11:05.000000000 -0700
@@ -29,6 +29,7 @@
#include <linux/capability.h>
#include <linux/syscalls.h>
#include <linux/memcontrol.h>
+#include <linux/ptemap.h>
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
diff -puN mm/vmalloc.c~include-linux-ptemaph-at-all-call-sites mm/vmalloc.c
--- linux-2.6.git/mm/vmalloc.c~include-linux-ptemaph-at-all-call-sites 2009-04-30 15:11:05.000000000 -0700
+++ linux-2.6.git-dave/mm/vmalloc.c 2009-04-30 15:11:05.000000000 -0700
@@ -25,6 +25,7 @@
#include <linux/rcupdate.h>
#include <linux/bootmem.h>
#include <linux/pfn.h>
+#include <linux/ptemap.h>
#include <asm/atomic.h>
#include <asm/uaccess.h>
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 23/35] factor x86 pte mapping code
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (21 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 22/35] include linux/ptemap.h at all use sites Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 24/35] arm: use pte_offset_kernel() as base for pte_offset_map*() Dave Hansen
` (11 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
x86 contains three separate pte_offset_map() implementations:
1. 32-bit highpte
2. 32-bit direct mapped
3. 64-bit direct mapped
This patch consolidates the 32-bit direct map and 64-bit
implementations. You can look back at the 00 patch in this
series to see a bit of proof about why
#define pte_offset_map(dir, address) \
((pte_t *)page_address(pmd_page(*(dir))) + pte_index((address)))
and
#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
are actually interchangable.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/x86/include/asm/ptemap.h | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff -puN arch/x86/include/asm/ptemap.h~factor-x86 arch/x86/include/asm/ptemap.h
--- linux-2.6.git/arch/x86/include/asm/ptemap.h~factor-x86 2009-04-30 15:11:06.000000000 -0700
+++ linux-2.6.git-dave/arch/x86/include/asm/ptemap.h 2009-04-30 15:11:06.000000000 -0700
@@ -1,10 +1,7 @@
#ifndef _X86_ASM_PTEMAP_H
#define _X86_ASM_PTEMAP_H
-#ifdef CONFIG_X86_32
-
#if defined(CONFIG_HIGHPTE)
-
#define pte_offset_map(dir, address) \
((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE0) + \
pte_index((address)))
@@ -13,21 +10,13 @@
pte_index((address)))
#define pte_unmap(pte) kunmap_atomic((pte), KM_PTE0)
#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
-#else
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + pte_index((address)))
-#define pte_offset_map_nested(dir, address) pte_offset_map((dir), (address))
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-#endif
-#else /* x86-64 */
+#else /* !CONFIG_HIGHPTE */
-/* x86-64 always has all page tables mapped. */
#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
-#define pte_unmap(pte) /* NOP */
-#define pte_unmap_nested(pte) /* NOP */
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
#endif
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 24/35] arm: use pte_offset_kernel() as base for pte_offset_map*()
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (22 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 23/35] factor x86 pte mapping code Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 25/35] cris: " Dave Hansen
` (10 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Some architectures use pte_offset_map() as a basis for
pte_offset_kernel(). Others do the inverse.
Although arbitrary, Using pte_offset_kernel() as the base
seems a wee bit more popular and it also fits in well
with the way I'm breaking out the headers.
Instead of coding the same implementation twice, this
makes pte_offset_map{,_nested}() call pte_offset_kernel()
directly.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/arm/include/asm/ptemap.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -puN arch/arm/include/asm/ptemap.h~arm-pte_offset_kernel arch/arm/include/asm/ptemap.h
--- linux-2.6.git/arch/arm/include/asm/ptemap.h~arm-pte_offset_kernel 2009-04-30 15:11:07.000000000 -0700
+++ linux-2.6.git-dave/arch/arm/include/asm/ptemap.h 2009-04-30 15:11:07.000000000 -0700
@@ -1,8 +1,8 @@
#ifndef _ARM_ASM_PTEMAP_H
#define _ARM_ASM_PTEMAP_H
-#define pte_offset_map(dir,addr) (pmd_page_vaddr(*(dir)) + pte_index(addr))
-#define pte_offset_map_nested(dir,addr) (pmd_page_vaddr(*(dir)) + pte_index(addr))
+#define pte_offset_map(dir,addr) pte_offset_kernel(dir,addr)
+#define pte_offset_map_nested(dir,addr) pte_offset_kernel(dir,addr)
#define pte_unmap(pte) do { } while (0)
#define pte_unmap_nested(pte) do { } while (0)
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 25/35] cris: use pte_offset_kernel() as base for pte_offset_map*()
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (23 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 24/35] arm: use pte_offset_kernel() as base for pte_offset_map*() Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 26/35] frv: " Dave Hansen
` (9 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Some architectures use pte_offset_map() as a basis for
pte_offset_kernel(). Others do the inverse.
Although arbitrary, Using pte_offset_kernel() as the base
seems a wee bit more popular and it also fits in well
with the way I'm breaking out the headers.
Instead of coding the same implementation twice, this
makes pte_offset_map{,_nested}() call pte_offset_kernel()
directly.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/cris/include/asm/ptemap.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff -puN arch/cris/include/asm/ptemap.h~cris-pte_offset_kernel arch/cris/include/asm/ptemap.h
--- linux-2.6.git/arch/cris/include/asm/ptemap.h~cris-pte_offset_kernel 2009-04-30 15:11:07.000000000 -0700
+++ linux-2.6.git-dave/arch/cris/include/asm/ptemap.h 2009-04-30 15:11:07.000000000 -0700
@@ -1,10 +1,8 @@
#ifndef _CRIS_ASM_PTEMAP_H
#define _CRIS_ASM_PTEMAP_H
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
-
+#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
+#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
#define pte_unmap(pte) do { } while (0)
#define pte_unmap_nested(pte) do { } while (0)
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 26/35] frv: use pte_offset_kernel() as base for pte_offset_map*()
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (24 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 25/35] cris: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 27/35] m32r: " Dave Hansen
` (8 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Some architectures use pte_offset_map() as a basis for
pte_offset_kernel(). Others do the inverse.
Although arbitrary, Using pte_offset_kernel() as the base
seems a wee bit more popular and it also fits in well
with the way I'm breaking out the headers.
Instead of coding the same implementation twice, this
makes pte_offset_map{,_nested}() call pte_offset_kernel()
directly.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/frv/include/asm/highmem.h | 5 +++++
linux-2.6.git-dave/arch/frv/include/asm/ptemap.h | 5 ++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff -puN arch/frv/include/asm/highmem.h~frv-pte_offset_kernel arch/frv/include/asm/highmem.h
--- linux-2.6.git/arch/frv/include/asm/highmem.h~frv-pte_offset_kernel 2009-04-30 15:11:08.000000000 -0700
+++ linux-2.6.git-dave/arch/frv/include/asm/highmem.h 2009-04-30 15:11:08.000000000 -0700
@@ -42,6 +42,11 @@ extern unsigned long highstart_pfn, high
#define kmap_prot PAGE_KERNEL
#define kmap_pte ______kmap_pte_in_TLB
+/*
+ * This lets us share the highpte pte_offset_map()
+ * with x86
+ */
+#define kmap_atomic_pte(page, type) kmap_atomic(page, type)
extern pte_t *pkmap_page_table;
#define flush_cache_kmaps() do { } while (0)
diff -puN arch/frv/include/asm/ptemap.h~frv-pte_offset_kernel arch/frv/include/asm/ptemap.h
--- linux-2.6.git/arch/frv/include/asm/ptemap.h~frv-pte_offset_kernel 2009-04-30 15:11:08.000000000 -0700
+++ linux-2.6.git-dave/arch/frv/include/asm/ptemap.h 2009-04-30 15:11:08.000000000 -0700
@@ -9,9 +9,8 @@
#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
#else
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
-#define pte_offset_map_nested(dir, address) pte_offset_map((dir), (address))
+#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
+#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
#define pte_unmap(pte) do { } while (0)
#define pte_unmap_nested(pte) do { } while (0)
#endif
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 27/35] m32r: use pte_offset_kernel() as base for pte_offset_map*()
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (25 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 26/35] frv: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 28/35] mips: " Dave Hansen
` (7 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Some architectures use pte_offset_map() as a basis for
pte_offset_kernel(). Others do the inverse.
Although arbitrary, Using pte_offset_kernel() as the base
seems a wee bit more popular and it also fits in well
with the way I'm breaking out the headers.
Instead of coding the same implementation twice, this
makes pte_offset_map{,_nested}() call pte_offset_kernel()
directly.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/m32r/include/asm/ptemap.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff -puN arch/m32r/include/asm/ptemap.h~m32r-pte_offset_kernel arch/m32r/include/asm/ptemap.h
--- linux-2.6.git/arch/m32r/include/asm/ptemap.h~m32r-pte_offset_kernel 2009-04-30 15:11:08.000000000 -0700
+++ linux-2.6.git-dave/arch/m32r/include/asm/ptemap.h 2009-04-30 15:11:08.000000000 -0700
@@ -1,9 +1,8 @@
#ifndef _M32R_ASM_PTEMAP_H
#define _M32R_ASM_PTEMAP_H
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
-#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
+#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
+#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
#define pte_unmap(pte) do { } while (0)
#define pte_unmap_nested(pte) do { } while (0)
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 28/35] mips: use pte_offset_kernel() as base for pte_offset_map*()
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (26 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 27/35] m32r: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 29/35] um: " Dave Hansen
` (6 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Some architectures use pte_offset_map() as a basis for
pte_offset_kernel(). Others do the inverse.
Although arbitrary, Using pte_offset_kernel() as the base
seems a wee bit more popular and it also fits in well
with the way I'm breaking out the headers.
Instead of coding the same implementation twice, this
makes pte_offset_map{,_nested}() call pte_offset_kernel()
directly.
On MIPS, it is also obvious at this point that the 32 and
64-bit implementations are identical. Coalesce them.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/mips/include/asm/pgtable-32.h | 3 +--
linux-2.6.git-dave/arch/mips/include/asm/pgtable-64.h | 3 +--
linux-2.6.git-dave/arch/mips/include/asm/ptemap.h | 17 ++---------------
3 files changed, 4 insertions(+), 19 deletions(-)
diff -puN arch/mips/include/asm/pgtable-32.h~mips-pte_offset_kernel arch/mips/include/asm/pgtable-32.h
--- linux-2.6.git/arch/mips/include/asm/pgtable-32.h~mips-pte_offset_kernel 2009-04-30 15:11:09.000000000 -0700
+++ linux-2.6.git-dave/arch/mips/include/asm/pgtable-32.h 2009-04-30 15:11:09.000000000 -0700
@@ -149,8 +149,7 @@ pfn_pte(unsigned long pfn, pgprot_t prot
(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
-#define pte_offset_kernel(dir, address) \
- ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
+#define pte_offset_kernel(dir, address) pte_offset(dir, address)
#include <asm/ptemap.h>
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
diff -puN arch/mips/include/asm/pgtable-64.h~mips-pte_offset_kernel arch/mips/include/asm/pgtable-64.h
--- linux-2.6.git/arch/mips/include/asm/pgtable-64.h~mips-pte_offset_kernel 2009-04-30 15:11:09.000000000 -0700
+++ linux-2.6.git-dave/arch/mips/include/asm/pgtable-64.h 2009-04-30 15:11:09.000000000 -0700
@@ -213,8 +213,7 @@ static inline pmd_t *pmd_offset(pud_t *
(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
-#define pte_offset_kernel(dir, address) \
- ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
+#define pte_offset_kernel(dir, address) pte_offset(dir, address)
#include <asm/ptemap.h>
/*
* Initialize a new pgd / pmd table with invalid pointers.
diff -puN arch/mips/include/asm/ptemap.h~mips-pte_offset_kernel arch/mips/include/asm/ptemap.h
--- linux-2.6.git/arch/mips/include/asm/ptemap.h~mips-pte_offset_kernel 2009-04-30 15:11:09.000000000 -0700
+++ linux-2.6.git-dave/arch/mips/include/asm/ptemap.h 2009-04-30 15:11:09.000000000 -0700
@@ -1,22 +1,9 @@
#ifndef _MIPS_ASM_PTEMAP_H
#define _MIPS_ASM_PTEMAP_H
-#ifdef CONFIG_32BIT
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_offset_map_nested(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
+#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
+#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
#define pte_unmap(pte) ((void)(pte))
#define pte_unmap_nested(pte) ((void)(pte))
-#endif
-
-#ifdef CONFIG_64BIT
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_offset_map_nested(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
-#define pte_unmap(pte) ((void)(pte))
-#define pte_unmap_nested(pte) ((void)(pte))
-#endif
#endif /* _MIPS_ASM_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 29/35] um: use pte_offset_kernel() as base for pte_offset_map*()
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (27 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 28/35] mips: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 30/35] m68k: " Dave Hansen
` (5 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Some architectures use pte_offset_map() as a basis for
pte_offset_kernel(). Others do the inverse.
Although arbitrary, Using pte_offset_kernel() as the base
seems a wee bit more popular and it also fits in well
with the way I'm breaking out the headers.
Instead of coding the same implementation twice, this
makes pte_offset_map{,_nested}() call pte_offset_kernel()
directly.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/um/include/asm/ptemap.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff -puN arch/um/include/asm/ptemap.h~um-pte_offset_kernel arch/um/include/asm/ptemap.h
--- linux-2.6.git/arch/um/include/asm/ptemap.h~um-pte_offset_kernel 2009-04-30 15:11:10.000000000 -0700
+++ linux-2.6.git-dave/arch/um/include/asm/ptemap.h 2009-04-30 15:11:10.000000000 -0700
@@ -1,9 +1,8 @@
#ifndef _UM_ASM_PTEMAP_H
#define _UM_ASM_PTEMAP_H
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
-#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
+#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
+#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
#define pte_unmap(pte) do { } while (0)
#define pte_unmap_nested(pte) do { } while (0)
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 30/35] m68k: use pte_offset_kernel() as base for pte_offset_map*()
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (28 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 29/35] um: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 31/35] mn10300: " Dave Hansen
` (4 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Some architectures use pte_offset_map() as a basis for
pte_offset_kernel(). Others do the inverse.
Although arbitrary, Using pte_offset_kernel() as the base
seems a wee bit more popular and it also fits in well
with the way I'm breaking out the headers.
Instead of coding the same implementation twice, this
makes pte_offset_map{,_nested}() call pte_offset_kernel()
directly.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/m68k/include/asm/ptemap.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -puN arch/m68k/include/asm/ptemap.h~m68k-pte_offset_kernel arch/m68k/include/asm/ptemap.h
--- linux-2.6.git/arch/m68k/include/asm/ptemap.h~m68k-pte_offset_kernel 2009-04-30 15:11:10.000000000 -0700
+++ linux-2.6.git-dave/arch/m68k/include/asm/ptemap.h 2009-04-30 15:11:10.000000000 -0700
@@ -12,8 +12,8 @@
#else /* !CONFIG_SUN3, Motorola */
-#define pte_offset_map(pmdp,address) ((pte_t *)__pmd_page(*pmdp) + (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
-#define pte_offset_map_nested(pmdp, address) pte_offset_map(pmdp, address)
+#define pte_offset_map(pmdp,address) pte_offset_kernel(pmdp, address)
+#define pte_offset_map_nested(pmdp, address) pte_offset_kernel(pmdp, address)
#define pte_unmap(pte) ((void)0)
#define pte_unmap_nested(pte) ((void)0)
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 31/35] mn10300: use pte_offset_kernel() as base for pte_offset_map*()
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (29 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 30/35] m68k: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 32/35] Move users to asm-generic/ptemap.h Dave Hansen
` (3 subsequent siblings)
34 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Some architectures use pte_offset_map() as a basis for
pte_offset_kernel(). Others do the inverse.
Although arbitrary, Using pte_offset_kernel() as the base
seems a wee bit more popular and it also fits in well
with the way I'm breaking out the headers.
Instead of coding the same implementation twice, this
makes pte_offset_map{,_nested}() call pte_offset_kernel()
directly.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/mn10300/include/asm/ptemap.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff -puN arch/mn10300/include/asm/ptemap.h~mn10300-pte_offset_kernel arch/mn10300/include/asm/ptemap.h
--- linux-2.6.git/arch/mn10300/include/asm/ptemap.h~mn10300-pte_offset_kernel 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/mn10300/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1,8 @@
#ifndef _MN10300_ASM_PTEMAP_H
#define _MN10300_ASM_PTEMAP_H
-#define pte_offset_map(dir, address) \
- ((pte_t *) page_address(pmd_page(*(dir))) + pte_index(address))
-#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
+#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
+#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
#define pte_unmap(pte) do {} while (0)
#define pte_unmap_nested(pte) do {} while (0)
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 32/35] Move users to asm-generic/ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (30 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 31/35] mn10300: " Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 17:43 ` Christoph Hellwig
2009-05-01 14:42 ` [RFC][PATCH 33/35] asm-generic/ptemap.h for HIGHPTE users Dave Hansen
` (2 subsequent siblings)
34 siblings, 1 reply; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Now that we have everyone using pte_offset_kernel(),
we can plainy see that almost all the users are
exactly the same.
This takes all of those users and moves them over to
using asm-generic/ptemap.h instead.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/alpha/include/asm/ptemap.h | 10 ------
linux-2.6.git-dave/arch/arm/include/asm/ptemap.h | 10 ------
linux-2.6.git-dave/arch/avr32/include/asm/ptemap.h | 10 ------
linux-2.6.git-dave/arch/cris/include/asm/ptemap.h | 10 ------
linux-2.6.git-dave/arch/frv/include/asm/ptemap.h | 5 ---
linux-2.6.git-dave/arch/ia64/include/asm/ptemap.h | 10 ------
linux-2.6.git-dave/arch/m32r/include/asm/ptemap.h | 10 ------
linux-2.6.git-dave/arch/m68k/include/asm/ptemap.h | 5 ---
linux-2.6.git-dave/arch/mips/include/asm/ptemap.h | 10 ------
linux-2.6.git-dave/arch/mn10300/include/asm/ptemap.h | 10 ------
linux-2.6.git-dave/arch/parisc/include/asm/ptemap.h | 13 --------
linux-2.6.git-dave/arch/powerpc/include/asm/ptemap.h | 5 ---
linux-2.6.git-dave/arch/s390/include/asm/ptemap.h | 10 ------
linux-2.6.git-dave/arch/sh/include/asm/ptemap.h | 10 ------
linux-2.6.git-dave/arch/sparc/include/asm/ptemap.h | 30 -------------------
linux-2.6.git-dave/arch/um/include/asm/ptemap.h | 10 ------
linux-2.6.git-dave/arch/x86/include/asm/ptemap.h | 5 ---
linux-2.6.git-dave/arch/xtensa/include/asm/ptemap.h | 11 ------
linux-2.6.git-dave/include/asm-generic/ptemap.h | 9 +++++
19 files changed, 27 insertions(+), 166 deletions(-)
diff -puN arch/alpha/include/asm/ptemap.h~asm-generic-ptemap-h arch/alpha/include/asm/ptemap.h
--- linux-2.6.git/arch/alpha/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/alpha/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1 @@
-#ifndef _ALPHA_ASM_PTEMAP_H
-#define _ALPHA_ASM_PTEMAP_H
-
-#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
-#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#endif /* _ALPHA_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/arm/include/asm/ptemap.h~asm-generic-ptemap-h arch/arm/include/asm/ptemap.h
--- linux-2.6.git/arch/arm/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/arm/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1 @@
-#ifndef _ARM_ASM_PTEMAP_H
-#define _ARM_ASM_PTEMAP_H
-
-#define pte_offset_map(dir,addr) pte_offset_kernel(dir,addr)
-#define pte_offset_map_nested(dir,addr) pte_offset_kernel(dir,addr)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#endif /* _ARM_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/avr32/include/asm/ptemap.h~asm-generic-ptemap-h arch/avr32/include/asm/ptemap.h
--- linux-2.6.git/arch/avr32/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/avr32/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1 @@
-#ifndef _AVR32_ASM_PTEMAP_H
-#define _AVR32_ASM_PTEMAP_H
-
-#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
-#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#endif /* _AVR32_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/cris/include/asm/ptemap.h~asm-generic-ptemap-h arch/cris/include/asm/ptemap.h
--- linux-2.6.git/arch/cris/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/cris/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1 @@
-#ifndef _CRIS_ASM_PTEMAP_H
-#define _CRIS_ASM_PTEMAP_H
-
-#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
-#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#endif /* _CRIS_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/frv/include/asm/ptemap.h~asm-generic-ptemap-h arch/frv/include/asm/ptemap.h
--- linux-2.6.git/arch/frv/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/frv/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -9,10 +9,7 @@
#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
#else
-#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
-#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+#include <asm-generic/ptemap.h>
#endif
#endif /* _FRV_ASM_PTEMAP_H */
diff -puN arch/ia64/include/asm/ptemap.h~asm-generic-ptemap-h arch/ia64/include/asm/ptemap.h
--- linux-2.6.git/arch/ia64/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/ia64/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1 @@
-#ifndef _IA64_ASM_PTEMAP_H
-#define _IA64_ASM_PTEMAP_H
-
-#define pte_offset_map(dir,addr) pte_offset_kernel(dir, addr)
-#define pte_offset_map_nested(dir,addr) pte_offset_map(dir, addr)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#endif /* _IA64_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/m32r/include/asm/ptemap.h~asm-generic-ptemap-h arch/m32r/include/asm/ptemap.h
--- linux-2.6.git/arch/m32r/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/m32r/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1 @@
-#ifndef _M32R_ASM_PTEMAP_H
-#define _M32R_ASM_PTEMAP_H
-
-#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
-#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#endif /* _M32R_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/m68k/include/asm/ptemap.h~asm-generic-ptemap-h arch/m68k/include/asm/ptemap.h
--- linux-2.6.git/arch/m68k/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/m68k/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -12,10 +12,7 @@
#else /* !CONFIG_SUN3, Motorola */
-#define pte_offset_map(pmdp,address) pte_offset_kernel(pmdp, address)
-#define pte_offset_map_nested(pmdp, address) pte_offset_kernel(pmdp, address)
-#define pte_unmap(pte) ((void)0)
-#define pte_unmap_nested(pte) ((void)0)
+#include <asm-generic/ptemap.h>
#endif /* CONFIG_SUN3 */
diff -puN arch/mips/include/asm/ptemap.h~asm-generic-ptemap-h arch/mips/include/asm/ptemap.h
--- linux-2.6.git/arch/mips/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/mips/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1 @@
-#ifndef _MIPS_ASM_PTEMAP_H
-#define _MIPS_ASM_PTEMAP_H
-
-#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
-#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
-#define pte_unmap(pte) ((void)(pte))
-#define pte_unmap_nested(pte) ((void)(pte))
-
-#endif /* _MIPS_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/mn10300/include/asm/ptemap.h~asm-generic-ptemap-h arch/mn10300/include/asm/ptemap.h
--- linux-2.6.git/arch/mn10300/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/mn10300/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1 @@
-#ifndef _MN10300_ASM_PTEMAP_H
-#define _MN10300_ASM_PTEMAP_H
-
-#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
-#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
-#define pte_unmap(pte) do {} while (0)
-#define pte_unmap_nested(pte) do {} while (0)
-
-#endif /* _MN10300_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/parisc/include/asm/ptemap.h~asm-generic-ptemap-h arch/parisc/include/asm/ptemap.h
--- linux-2.6.git/arch/parisc/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/parisc/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,12 +1 @@
-#ifndef _PARISC_ASM_PTEMAP_H
-#define _PARISC_ASM_PTEMAP_H
-
-#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
-#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#endif /* _PARISC_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/powerpc/include/asm/ptemap.h~asm-generic-ptemap-h arch/powerpc/include/asm/ptemap.h
--- linux-2.6.git/arch/powerpc/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -13,10 +13,7 @@
#else /* __powerpc64__ */
-#define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr))
-#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr))
-#define pte_unmap(pte) do { } while(0)
-#define pte_unmap_nested(pte) do { } while(0)
+#include <asm-generic/ptemap.h>
#endif
diff -puN arch/s390/include/asm/ptemap.h~asm-generic-ptemap-h arch/s390/include/asm/ptemap.h
--- linux-2.6.git/arch/s390/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/s390/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1 @@
-#ifndef _S390_ASM_PTEMAP_H
-#define _S390_ASM_PTEMAP_H
-
-#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
-#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#endif /* _S390_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/sh/include/asm/ptemap.h~asm-generic-ptemap-h arch/sh/include/asm/ptemap.h
--- linux-2.6.git/arch/sh/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/sh/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1 @@
-#ifndef _SH_ASM_PTEMAP_H
-#define _SH_ASM_PTEMAP_H
-
-#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
-#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#endif /* _SH_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/sparc/include/asm/ptemap.h~asm-generic-ptemap-h arch/sparc/include/asm/ptemap.h
--- linux-2.6.git/arch/sparc/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,29 +1 @@
-#ifndef _SPARC_ASM_PTEMAP_H
-#define _SPARC_ASM_PTEMAP_H
-
-#if defined(__sparc__) && defined(__arch64__)
-
-/* Certain architectures need to do special things when pte's
- * within a page table are directly modified. Thus, the following
- * hook is made available.
- */
-
-#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
-#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#else
-
- * This shortcut works on sun4m (and sun4d) because the nocache area is static,
- * and sun4c is guaranteed to have no highmem anyway.
- */
-#define pte_offset_map(d, a) pte_offset_kernel(d,a)
-#define pte_offset_map_nested(d, a) pte_offset_kernel(d,a)
-
-#define pte_unmap(pte) do{}while(0)
-#define pte_unmap_nested(pte) do{}while(0)
-
-#endif
-
-#endif /* _SPARC_ASM_PTEMAP_H *//*
+#include <asm-generic/ptemap.h>
diff -puN arch/um/include/asm/ptemap.h~asm-generic-ptemap-h arch/um/include/asm/ptemap.h
--- linux-2.6.git/arch/um/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/um/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,9 +1 @@
-#ifndef _UM_ASM_PTEMAP_H
-#define _UM_ASM_PTEMAP_H
-
-#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
-#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#endif /* _UM_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN arch/x86/include/asm/ptemap.h~asm-generic-ptemap-h arch/x86/include/asm/ptemap.h
--- linux-2.6.git/arch/x86/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/x86/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -13,10 +13,7 @@
#else /* !CONFIG_HIGHPTE */
-#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
-#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
+#include <asm-generic/ptemap.h>
#endif
diff -puN arch/xtensa/include/asm/ptemap.h~asm-generic-ptemap-h arch/xtensa/include/asm/ptemap.h
--- linux-2.6.git/arch/xtensa/include/asm/ptemap.h~asm-generic-ptemap-h 2009-04-30 15:11:11.000000000 -0700
+++ linux-2.6.git-dave/arch/xtensa/include/asm/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -1,10 +1 @@
-#ifndef _XTENSA_ASM_PTEMAP_H
-#define _XTENSA_ASM_PTEMAP_H
-
-#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
-#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
-
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-
-#endif /* _XTENSA_ASM_PTEMAP_H */
+#include <asm-generic/ptemap.h>
diff -puN /dev/null include/asm-generic/ptemap.h
--- /dev/null 2008-09-02 09:40:19.000000000 -0700
+++ linux-2.6.git-dave/include/asm-generic/ptemap.h 2009-04-30 15:11:11.000000000 -0700
@@ -0,0 +1,9 @@
+#ifndef _ASM_GENERIC_PTEMAP_H
+#define _ASM_GENERIC_PTEMAP_H
+
+#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
+#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+
+#endif /* _ASM_GENERIC_PTEMAP_H */
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 33/35] asm-generic/ptemap.h for HIGHPTE users
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (31 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 32/35] Move users to asm-generic/ptemap.h Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 17:51 ` Luck, Tony
2009-05-01 14:42 ` [RFC][PATCH 34/35] powerpc use generic ptemap.h Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 35/35] remove old ptemap.h includes Dave Hansen
34 siblings, 1 reply; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
x86 and frv have identical CONFIG_HIGHPTE implementations
of the pte mapping functions. Consolidate and move these
to asm-generic/ptemap.h.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/frv/include/asm/ptemap.h | 14 --------------
linux-2.6.git-dave/arch/x86/include/asm/ptemap.h | 19 -------------------
linux-2.6.git-dave/include/asm-generic/ptemap.h | 13 +++++++++++++
3 files changed, 13 insertions(+), 33 deletions(-)
diff -puN arch/frv/include/asm/ptemap.h~asm-generic-ptemap-h-highpte arch/frv/include/asm/ptemap.h
--- linux-2.6.git/arch/frv/include/asm/ptemap.h~asm-generic-ptemap-h-highpte 2009-04-30 15:11:12.000000000 -0700
+++ linux-2.6.git-dave/arch/frv/include/asm/ptemap.h 2009-04-30 15:11:12.000000000 -0700
@@ -1,15 +1 @@
-#ifndef _FRV_ASM_PTEMAP_H
-#define _FRV_ASM_PTEMAP_H
-
-#if defined(CONFIG_HIGHPTE)
-#define pte_offset_map(dir, address) \
- ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE0) + pte_index(address))
-#define pte_offset_map_nested(dir, address) \
- ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE1) + pte_index(address))
-#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
-#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
-#else
#include <asm-generic/ptemap.h>
-#endif
-
-#endif /* _FRV_ASM_PTEMAP_H */
diff -puN arch/x86/include/asm/ptemap.h~asm-generic-ptemap-h-highpte arch/x86/include/asm/ptemap.h
--- linux-2.6.git/arch/x86/include/asm/ptemap.h~asm-generic-ptemap-h-highpte 2009-04-30 15:11:12.000000000 -0700
+++ linux-2.6.git-dave/arch/x86/include/asm/ptemap.h 2009-04-30 15:11:12.000000000 -0700
@@ -1,20 +1 @@
-#ifndef _X86_ASM_PTEMAP_H
-#define _X86_ASM_PTEMAP_H
-
-#if defined(CONFIG_HIGHPTE)
-#define pte_offset_map(dir, address) \
- ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE0) + \
- pte_index((address)))
-#define pte_offset_map_nested(dir, address) \
- ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE1) + \
- pte_index((address)))
-#define pte_unmap(pte) kunmap_atomic((pte), KM_PTE0)
-#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
-
-#else /* !CONFIG_HIGHPTE */
-
#include <asm-generic/ptemap.h>
-
-#endif
-
-#endif /* _X86_ASM_PTEMAP_H */
diff -puN include/asm-generic/ptemap.h~asm-generic-ptemap-h-highpte include/asm-generic/ptemap.h
--- linux-2.6.git/include/asm-generic/ptemap.h~asm-generic-ptemap-h-highpte 2009-04-30 15:11:12.000000000 -0700
+++ linux-2.6.git-dave/include/asm-generic/ptemap.h 2009-04-30 15:11:12.000000000 -0700
@@ -1,6 +1,19 @@
#ifndef _ASM_GENERIC_PTEMAP_H
#define _ASM_GENERIC_PTEMAP_H
+#include <linux/mm.h>
+
+#ifdef CONFIG_HIGHPTE
+#include <asm/highmem.h>
+#define pte_offset_map(dir, address) \
+ ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE0) + pte_index(address))
+#define pte_offset_map_nested(dir, address) \
+ ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE1) + pte_index(address))
+#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
+#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
+
+#else /* !CONFIG_HIGHPTE */
+
#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
#define pte_unmap(pte) do { } while (0)
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 34/35] powerpc use generic ptemap.h
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (32 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 33/35] asm-generic/ptemap.h for HIGHPTE users Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 17:46 ` Christoph Hellwig
2009-05-17 3:55 ` Benjamin Herrenschmidt
2009-05-01 14:42 ` [RFC][PATCH 35/35] remove old ptemap.h includes Dave Hansen
34 siblings, 2 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
powerpc is a bid of an oddball here. It seems to have CONFIG_HIGHPTE
behavior at all times when compiled as 32-bit. There's even an
#ifdef CONFIG_HIGHPTE in arch/powerpc/mm/pgtable_32.c, but there's no
trace of HIGHPTE in Kconfig anywhere.
This gives ppc32 an explicit HIGHPTE in Kconfig so that we can use
the #ifdef in asm-generic/ptemap.h and let ppc use the generic code
with x86 and frv.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/powerpc/Kconfig | 4 ++++
linux-2.6.git-dave/arch/powerpc/include/asm/ptemap.h | 18 ++++++------------
2 files changed, 10 insertions(+), 12 deletions(-)
diff -puN arch/powerpc/include/asm/ptemap.h~powerpc-pte_offset_kernel arch/powerpc/include/asm/ptemap.h
--- linux-2.6.git/arch/powerpc/include/asm/ptemap.h~powerpc-pte_offset_kernel 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/include/asm/ptemap.h 2009-04-30 15:11:13.000000000 -0700
@@ -2,19 +2,13 @@
#define _POWERPC_ASM_PTEMAP_H
#ifndef __powerpc64__
-
-#define pte_offset_map(dir, addr) \
- ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE0) + pte_index(addr))
-#define pte_offset_map_nested(dir, addr) \
- ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE1) + pte_index(addr))
-
-#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
-#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
-
-#else /* __powerpc64__ */
+/*
+ * This lets us use the x86 implementation
+ * in the generic ptemap.h
+ */
+#define kmap_atomic_pte(page, type) kmap_atomic(page, type)
+#endif
#include <asm-generic/ptemap.h>
-#endif
-
#endif /* _POWERPC_ASM_PTEMAP_H */
diff -puN arch/powerpc/Kconfig~powerpc-pte_offset_kernel arch/powerpc/Kconfig
--- linux-2.6.git/arch/powerpc/Kconfig~powerpc-pte_offset_kernel 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/Kconfig 2009-04-30 15:11:13.000000000 -0700
@@ -244,6 +244,10 @@ config HIGHMEM
bool "High memory support"
depends on PPC32
+config HIGHPTE
+ def_bool y
+ depends on HIGHMEM
+
source kernel/time/Kconfig
source kernel/Kconfig.hz
source kernel/Kconfig.preempt
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* [RFC][PATCH 35/35] remove old ptemap.h includes
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
` (33 preceding siblings ...)
2009-05-01 14:42 ` [RFC][PATCH 34/35] powerpc use generic ptemap.h Dave Hansen
@ 2009-05-01 14:42 ` Dave Hansen
2009-05-01 14:59 ` Ingo Molnar
34 siblings, 1 reply; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 14:42 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Dave Hansen
Now that we're directly including ptemap.h everywhere we need it
we no longer need the includes from all the various arch
headers. Kill them.
Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---
linux-2.6.git-dave/arch/alpha/include/asm/pgtable.h | 2 +-
linux-2.6.git-dave/arch/arm/include/asm/pgtable.h | 2 --
linux-2.6.git-dave/arch/cris/include/asm/pgtable.h | 1 -
linux-2.6.git-dave/arch/frv/include/asm/pgtable.h | 2 --
linux-2.6.git-dave/arch/ia64/include/asm/pgtable.h | 2 --
linux-2.6.git-dave/arch/m32r/include/asm/pgtable.h | 1 -
linux-2.6.git-dave/arch/m68k/include/asm/motorola_pgtable.h | 2 --
linux-2.6.git-dave/arch/m68k/include/asm/sun3_pgtable.h | 3 ---
linux-2.6.git-dave/arch/mips/include/asm/pgtable-32.h | 1 -
linux-2.6.git-dave/arch/mips/include/asm/pgtable-64.h | 1 -
linux-2.6.git-dave/arch/mn10300/include/asm/pgtable.h | 2 --
linux-2.6.git-dave/arch/parisc/include/asm/pgtable.h | 2 --
linux-2.6.git-dave/arch/powerpc/include/asm/pgtable-ppc64.h | 2 --
linux-2.6.git-dave/arch/s390/include/asm/pgtable.h | 2 --
linux-2.6.git-dave/arch/sh/include/asm/pgtable_32.h | 1 -
linux-2.6.git-dave/arch/sh/include/asm/pgtable_64.h | 2 --
linux-2.6.git-dave/arch/sparc/include/asm/pgtable_32.h | 2 --
linux-2.6.git-dave/arch/sparc/include/asm/pgtable_64.h | 2 --
linux-2.6.git-dave/arch/um/include/asm/pgtable.h | 1 -
linux-2.6.git-dave/arch/x86/include/asm/pgtable_32.h | 2 --
linux-2.6.git-dave/arch/x86/include/asm/pgtable_64.h | 2 --
21 files changed, 1 insertion(+), 36 deletions(-)
diff -puN arch/alpha/include/asm/pgtable.h~remove-old-ptemap-includes arch/alpha/include/asm/pgtable.h
--- linux-2.6.git/arch/alpha/include/asm/pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/alpha/include/asm/pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -317,7 +317,7 @@ extern inline pte_t * pte_offset_kernel(
return ret;
}
-#inclue <asm/ptemap.h>
+#include <asm/ptemap.h>
extern pgd_t swapper_pg_dir[1024];
diff -puN arch/arm/include/asm/pgtable.h~remove-old-ptemap-includes arch/arm/include/asm/pgtable.h
--- linux-2.6.git/arch/arm/include/asm/pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/arm/include/asm/pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -265,8 +265,6 @@ extern struct page *empty_zero_page;
#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
#define pte_offset_kernel(dir,addr) (pmd_page_vaddr(*(dir)) + pte_index(addr))
-#include <asm/ptemap.h>
-
#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
#define set_pte_at(mm,addr,ptep,pteval) do { \
diff -puN arch/cris/include/asm/pgtable.h~remove-old-ptemap-includes arch/cris/include/asm/pgtable.h
--- linux-2.6.git/arch/cris/include/asm/pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/cris/include/asm/pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -244,7 +244,6 @@ static inline pgd_t * pgd_offset(const s
(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
-#include <asm/ptemap.h>
#define pte_pfn(x) ((unsigned long)(__va((x).pte)) >> PAGE_SHIFT)
#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
diff -puN arch/frv/include/asm/pgtable.h~remove-old-ptemap-includes arch/frv/include/asm/pgtable.h
--- linux-2.6.git/arch/frv/include/asm/pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/frv/include/asm/pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -449,8 +449,6 @@ static inline pte_t pte_modify(pte_t pte
#define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
-#include <asm/ptemap.h>
-
/*
* Handle swap and file entries
* - the PTE is encoded in the following format:
diff -puN arch/ia64/include/asm/pgtable.h~remove-old-ptemap-includes arch/ia64/include/asm/pgtable.h
--- linux-2.6.git/arch/ia64/include/asm/pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/ia64/include/asm/pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -406,8 +406,6 @@ pgd_offset (const struct mm_struct *mm,
#define pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir,addr) ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr))
-#include <asm/ptemap.h>
-
/* atomic versions of the some PTE manipulations: */
static inline int
diff -puN arch/m32r/include/asm/pgtable.h~remove-old-ptemap-includes arch/m32r/include/asm/pgtable.h
--- linux-2.6.git/arch/m32r/include/asm/pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/m32r/include/asm/pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -330,7 +330,6 @@ static inline void pmd_set(pmd_t * pmdp,
(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, address) \
((pte_t *)pmd_page_vaddr(*(dir)) + pte_index(address))
-#include <asm/ptemap.h>
/* Encode and de-code a swap entry */
#define __swp_type(x) (((x).val >> 2) & 0x1f)
diff -puN arch/m68k/include/asm/motorola_pgtable.h~remove-old-ptemap-includes arch/m68k/include/asm/motorola_pgtable.h
--- linux-2.6.git/arch/m68k/include/asm/motorola_pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/m68k/include/asm/motorola_pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -220,8 +220,6 @@ static inline pte_t *pte_offset_kernel(p
return (pte_t *)__pmd_page(*pmdp) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
}
-#include <asm/ptemap.h>
-
/*
* Allocate and free page tables. The xxx_kernel() versions are
* used to allocate a kernel page table - this turns on ASN bits
diff -puN arch/m68k/include/asm/sun3_pgtable.h~remove-old-ptemap-includes arch/m68k/include/asm/sun3_pgtable.h
--- linux-2.6.git/arch/m68k/include/asm/sun3_pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/m68k/include/asm/sun3_pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -217,9 +217,6 @@ static inline pte_t pgoff_to_pte(unsigne
/* Find an entry in the third-level pagetable. */
#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
#define pte_offset_kernel(pmd, address) ((pte_t *) __pmd_page(*pmd) + pte_index(address))
-/* FIXME: should we bother with kmap() here? */
-
-#include <asm/ptemap.h>
/* Macros to (de)construct the fake PTEs representing swap pages. */
#define __swp_type(x) ((x).val & 0x7F)
diff -puN arch/mips/include/asm/pgtable-32.h~remove-old-ptemap-includes arch/mips/include/asm/pgtable-32.h
--- linux-2.6.git/arch/mips/include/asm/pgtable-32.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/mips/include/asm/pgtable-32.h 2009-04-30 15:11:13.000000000 -0700
@@ -150,7 +150,6 @@ pfn_pte(unsigned long pfn, pgprot_t prot
#define pte_offset(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
#define pte_offset_kernel(dir, address) pte_offset(dir, address)
-#include <asm/ptemap.h>
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
diff -puN arch/mips/include/asm/pgtable-64.h~remove-old-ptemap-includes arch/mips/include/asm/pgtable-64.h
--- linux-2.6.git/arch/mips/include/asm/pgtable-64.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/mips/include/asm/pgtable-64.h 2009-04-30 15:11:13.000000000 -0700
@@ -214,7 +214,6 @@ static inline pmd_t *pmd_offset(pud_t *
#define pte_offset(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
#define pte_offset_kernel(dir, address) pte_offset(dir, address)
-#include <asm/ptemap.h>
/*
* Initialize a new pgd / pmd table with invalid pointers.
*/
diff -puN arch/mn10300/include/asm/pgtable.h~remove-old-ptemap-includes arch/mn10300/include/asm/pgtable.h
--- linux-2.6.git/arch/mn10300/include/asm/pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/mn10300/include/asm/pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -455,8 +455,6 @@ static inline int set_kernel_exec(unsign
return 0;
}
-#include <asm/ptemap.h>
-
/*
* The MN10300 has external MMU info in the form of a TLB: this is adapted from
* the kernel page tables containing the necessary information by tlb-mn10300.S
diff -puN arch/parisc/include/asm/pgtable.h~remove-old-ptemap-includes arch/parisc/include/asm/pgtable.h
--- linux-2.6.git/arch/parisc/include/asm/pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/parisc/include/asm/pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -397,8 +397,6 @@ static inline pte_t pte_modify(pte_t pte
#define pte_offset_kernel(pmd, address) \
((pte_t *) pmd_page_vaddr(*(pmd)) + pte_index(address))
-#include <asm/ptemap.h>
-
extern void paging_init (void);
/* Used for deferring calls to flush_dcache_page() */
diff -puN arch/powerpc/include/asm/pgtable-ppc64.h~remove-old-ptemap-includes arch/powerpc/include/asm/pgtable-ppc64.h
--- linux-2.6.git/arch/powerpc/include/asm/pgtable-ppc64.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/powerpc/include/asm/pgtable-ppc64.h 2009-04-30 15:11:13.000000000 -0700
@@ -162,8 +162,6 @@
#define pte_offset_kernel(dir,addr) \
(((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
-#include <asm/ptemap.h>
-
/* to find an entry in a kernel page-table-directory */
/* This now only contains the vmalloc pages */
#define pgd_offset_k(address) pgd_offset(&init_mm, address)
diff -puN arch/s390/include/asm/pgtable.h~remove-old-ptemap-includes arch/s390/include/asm/pgtable.h
--- linux-2.6.git/arch/s390/include/asm/pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/s390/include/asm/pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -1041,8 +1041,6 @@ static inline pmd_t *pmd_offset(pud_t *p
#define pte_offset(pmd, addr) ((pte_t *) pmd_deref(*(pmd)) + pte_index(addr))
#define pte_offset_kernel(pmd, address) pte_offset(pmd,address)
-#include <asm/ptemap.h>
-
/*
* 31 bit swap entry format:
* A page-table entry has some bits we have to treat in a special way.
diff -puN arch/sh/include/asm/pgtable_32.h~remove-old-ptemap-includes arch/sh/include/asm/pgtable_32.h
--- linux-2.6.git/arch/sh/include/asm/pgtable_32.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/sh/include/asm/pgtable_32.h 2009-04-30 15:11:13.000000000 -0700
@@ -403,7 +403,6 @@ static inline pte_t pte_modify(pte_t pte
#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
-#include <asm/ptemap.h>
#ifdef CONFIG_X2TLB
#define pte_ERROR(e) \
diff -puN arch/sh/include/asm/pgtable_64.h~remove-old-ptemap-includes arch/sh/include/asm/pgtable_64.h
--- linux-2.6.git/arch/sh/include/asm/pgtable_64.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/sh/include/asm/pgtable_64.h 2009-04-30 15:11:13.000000000 -0700
@@ -83,8 +83,6 @@ static __inline__ void pmd_set(pmd_t *pm
#define pte_offset_kernel(dir, addr) \
((pte_t *) ((pmd_val(*(dir))) & PAGE_MASK) + pte_index((addr)))
-#include <asm/ptemap.h>
-
#ifndef __ASSEMBLY__
#define IOBASE_VADDR 0xff000000
#define IOBASE_END 0xffffffff
diff -puN arch/sparc/include/asm/pgtable_32.h~remove-old-ptemap-includes arch/sparc/include/asm/pgtable_32.h
--- linux-2.6.git/arch/sparc/include/asm/pgtable_32.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/include/asm/pgtable_32.h 2009-04-30 15:11:13.000000000 -0700
@@ -300,8 +300,6 @@ BTFIXUPDEF_CALL(pmd_t *, pmd_offset, pgd
BTFIXUPDEF_CALL(pte_t *, pte_offset_kernel, pmd_t *, unsigned long)
#define pte_offset_kernel(dir,addr) BTFIXUP_CALL(pte_offset_kernel)(dir,addr)
-#include <asm/ptemap.h>
-
BTFIXUPDEF_CALL(void, set_pte, pte_t *, pte_t)
#define set_pte(ptep,pteval) BTFIXUP_CALL(set_pte)(ptep,pteval)
diff -puN arch/sparc/include/asm/pgtable_64.h~remove-old-ptemap-includes arch/sparc/include/asm/pgtable_64.h
--- linux-2.6.git/arch/sparc/include/asm/pgtable_64.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/sparc/include/asm/pgtable_64.h 2009-04-30 15:11:13.000000000 -0700
@@ -652,8 +652,6 @@ static inline int pte_special(pte_t pte)
/* Find an entry in the third-level page table.. */
#define pte_offset_kernel(dir, address) \
((pte_t *)pmd_page_vaddr(*(dir)) + pte_index(address))
-#include <asm/ptemap.h>
-
/* Actual page table PTE updates. */
extern void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t orig);
diff -puN arch/um/include/asm/pgtable.h~remove-old-ptemap-includes arch/um/include/asm/pgtable.h
--- linux-2.6.git/arch/um/include/asm/pgtable.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/um/include/asm/pgtable.h 2009-04-30 15:11:13.000000000 -0700
@@ -331,7 +331,6 @@ static inline pte_t pte_modify(pte_t pte
#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
-#include <asm/ptemap.h>
struct mm_struct;
extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
diff -puN arch/x86/include/asm/pgtable_32.h~remove-old-ptemap-includes arch/x86/include/asm/pgtable_32.h
--- linux-2.6.git/arch/x86/include/asm/pgtable_32.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/x86/include/asm/pgtable_32.h 2009-04-30 15:11:13.000000000 -0700
@@ -48,8 +48,6 @@ extern void set_pmd_pfn(unsigned long, u
# include <asm/pgtable-2level.h>
#endif
-#include <asm/ptemap.h>
-
/* Clear a kernel PTE and flush it from the TLB */
#define kpte_clear_flush(ptep, vaddr) \
do { \
diff -puN arch/x86/include/asm/pgtable_64.h~remove-old-ptemap-includes arch/x86/include/asm/pgtable_64.h
--- linux-2.6.git/arch/x86/include/asm/pgtable_64.h~remove-old-ptemap-includes 2009-04-30 15:11:13.000000000 -0700
+++ linux-2.6.git-dave/arch/x86/include/asm/pgtable_64.h 2009-04-30 15:11:13.000000000 -0700
@@ -127,8 +127,6 @@ static inline int pgd_large(pgd_t pgd) {
/* PTE - Level 1 access. */
-#include <asm/ptemap.h>
-
#define update_mmu_cache(vma, address, pte) do { } while (0)
extern int direct_gbpages;
_
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [RFC][PATCH 35/35] remove old ptemap.h includes
2009-05-01 14:42 ` [RFC][PATCH 35/35] remove old ptemap.h includes Dave Hansen
@ 2009-05-01 14:59 ` Ingo Molnar
2009-05-01 15:02 ` Dave Hansen
0 siblings, 1 reply; 51+ messages in thread
From: Ingo Molnar @ 2009-05-01 14:59 UTC (permalink / raw)
To: Dave Hansen; +Cc: linux-arch, linux-kernel
* Dave Hansen <dave@linux.vnet.ibm.com> wrote:
> +++ linux-2.6.git-dave/arch/alpha/include/asm/pgtable.h 2009-04-30 15:11:13.000000000 -0700
> @@ -317,7 +317,7 @@ extern inline pte_t * pte_offset_kernel(
> return ret;
> }
>
> -#inclue <asm/ptemap.h>
> +#include <asm/ptemap.h>
that typo fix should be backmerged to earlier in the series i guess.
Ingo
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [RFC][PATCH 35/35] remove old ptemap.h includes
2009-05-01 14:59 ` Ingo Molnar
@ 2009-05-01 15:02 ` Dave Hansen
0 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 15:02 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-arch, linux-kernel
On Fri, 2009-05-01 at 16:59 +0200, Ingo Molnar wrote:
> * Dave Hansen <dave@linux.vnet.ibm.com> wrote:
> > +++
> linux-2.6.git-dave/arch/alpha/include/asm/pgtable.h 2009-04-30
> 15:11:13.000000000 -0700
> > @@ -317,7 +317,7 @@ extern inline pte_t * pte_offset_kernel(
> > return ret;
> > }
> >
> > -#inclue <asm/ptemap.h>
> > +#include <asm/ptemap.h>
>
> that typo fix should be backmerged to earlier in the series i guess.
Whoops. Got it now, thanks.
-- Dave
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [RFC][PATCH 32/35] Move users to asm-generic/ptemap.h
2009-05-01 14:42 ` [RFC][PATCH 32/35] Move users to asm-generic/ptemap.h Dave Hansen
@ 2009-05-01 17:43 ` Christoph Hellwig
2009-05-01 18:08 ` Dave Hansen
0 siblings, 1 reply; 51+ messages in thread
From: Christoph Hellwig @ 2009-05-01 17:43 UTC (permalink / raw)
To: Dave Hansen; +Cc: linux-arch, linux-kernel
On Fri, May 01, 2009 at 07:42:51AM -0700, Dave Hansen wrote:
>
> Now that we have everyone using pte_offset_kernel(),
> we can plainy see that almost all the users are
> exactly the same.
>
> This takes all of those users and moves them over to
> using asm-generic/ptemap.h instead.
s/users/implementations/g ?
Also asm-generic/ptemap.h really wants a comment when architectures
can use this generic version.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [RFC][PATCH 34/35] powerpc use generic ptemap.h
2009-05-01 14:42 ` [RFC][PATCH 34/35] powerpc use generic ptemap.h Dave Hansen
@ 2009-05-01 17:46 ` Christoph Hellwig
2009-05-01 17:58 ` Dave Hansen
2009-05-17 3:55 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 51+ messages in thread
From: Christoph Hellwig @ 2009-05-01 17:46 UTC (permalink / raw)
To: Dave Hansen; +Cc: linux-arch, linux-kernel
On Fri, May 01, 2009 at 07:42:54AM -0700, Dave Hansen wrote:
>
> powerpc is a bid of an oddball here. It seems to have CONFIG_HIGHPTE
> behavior at all times when compiled as 32-bit. There's even an
> #ifdef CONFIG_HIGHPTE in arch/powerpc/mm/pgtable_32.c, but there's no
> trace of HIGHPTE in Kconfig anywhere.
>
> This gives ppc32 an explicit HIGHPTE in Kconfig so that we can use
> the #ifdef in asm-generic/ptemap.h and let ppc use the generic code
> with x86 and frv.
But if you enabled HIGHPTE you need to remove that ifdef in pgtable_32.c
because it didn't get triggered before.
> #define _POWERPC_ASM_PTEMAP_H
>
> #ifndef __powerpc64__
> +/*
> + * This lets us use the x86 implementation
> + * in the generic ptemap.h
> + */
> +#define kmap_atomic_pte(page, type) kmap_atomic(page, type)
> +#endif
That comment doesn't make any sense to me, x86 should have nothing to do
with it. Also the comment would comfortably fit into a single line
instead of two.
^ permalink raw reply [flat|nested] 51+ messages in thread
* RE: [RFC][PATCH 33/35] asm-generic/ptemap.h for HIGHPTE users
2009-05-01 14:42 ` [RFC][PATCH 33/35] asm-generic/ptemap.h for HIGHPTE users Dave Hansen
@ 2009-05-01 17:51 ` Luck, Tony
2009-05-01 18:10 ` Dave Hansen
0 siblings, 1 reply; 51+ messages in thread
From: Luck, Tony @ 2009-05-01 17:51 UTC (permalink / raw)
To: Dave Hansen, linux-arch@vger.kernel.org; +Cc: linux-kernel@vger.kernel.org
> diff -puN include/asm-generic/ptemap.h~asm-generic-ptemap-h-highpte include/asm-generic/ptemap.h
> +#ifdef CONFIG_HIGHPTE
> +#include <asm/highmem.h>
> +#define pte_offset_map(dir, address) \
> + ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE0) + pte_index(address))
> +#define pte_offset_map_nested(dir, address) \
> + ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE1) + pte_index(address))
> +#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
> +#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
> +
> +#else /* !CONFIG_HIGHPTE */
> +
> #define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
> #define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
> #define pte_unmap(pte) do { } while (0)
You need to add a closing #endif here.
-Tony
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [RFC][PATCH 34/35] powerpc use generic ptemap.h
2009-05-01 17:46 ` Christoph Hellwig
@ 2009-05-01 17:58 ` Dave Hansen
0 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 17:58 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-arch, linux-kernel
On Fri, 2009-05-01 at 13:46 -0400, Christoph Hellwig wrote:
> On Fri, May 01, 2009 at 07:42:54AM -0700, Dave Hansen wrote:
> > powerpc is a bid of an oddball here. It seems to have CONFIG_HIGHPTE
> > behavior at all times when compiled as 32-bit. There's even an
> > #ifdef CONFIG_HIGHPTE in arch/powerpc/mm/pgtable_32.c, but there's no
> > trace of HIGHPTE in Kconfig anywhere.
> >
> > This gives ppc32 an explicit HIGHPTE in Kconfig so that we can use
> > the #ifdef in asm-generic/ptemap.h and let ppc use the generic code
> > with x86 and frv.
>
> But if you enabled HIGHPTE you need to remove that ifdef in pgtable_32.c
> because it didn't get triggered before.
OK, that makes sense.
> > #define _POWERPC_ASM_PTEMAP_H
> >
> > #ifndef __powerpc64__
> > +/*
> > + * This lets us use the x86 implementation
> > + * in the generic ptemap.h
> > + */
> > +#define kmap_atomic_pte(page, type) kmap_atomic(page, type)
> > +#endif
>
> That comment doesn't make any sense to me, x86 should have nothing to do
> with it. Also the comment would comfortably fit into a single line
> instead of two.
You're right, that is more of a changelog thing. I'll fix it up.
-- Dave
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [RFC][PATCH 32/35] Move users to asm-generic/ptemap.h
2009-05-01 17:43 ` Christoph Hellwig
@ 2009-05-01 18:08 ` Dave Hansen
0 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 18:08 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-arch, linux-kernel
On Fri, 2009-05-01 at 13:43 -0400, Christoph Hellwig wrote:
> On Fri, May 01, 2009 at 07:42:51AM -0700, Dave Hansen wrote:
> > Now that we have everyone using pte_offset_kernel(),
> > we can plainy see that almost all the users are
> > exactly the same.
> >
> > This takes all of those users and moves them over to
> > using asm-generic/ptemap.h instead.
>
> s/users/implementations/g ?
Yeah, that's clearer.
> Also asm-generic/ptemap.h really wants a comment when architectures
> can use this generic version.
/*
* If your architecture has direct-mapped PTE pages (no HIGHPTE)
* then you just need to implement pte_offset_kernel() and include
* this in your asm/ptemap.h.
*
* To support HIGHPTE, you need to have implementations of
* kmap_atomic_pte() (which usually just calls kmap_atomic()),
* pmd_page() and pmd_index().
*/
-- Dave
^ permalink raw reply [flat|nested] 51+ messages in thread
* RE: [RFC][PATCH 33/35] asm-generic/ptemap.h for HIGHPTE users
2009-05-01 17:51 ` Luck, Tony
@ 2009-05-01 18:10 ` Dave Hansen
2009-05-01 18:29 ` Luck, Tony
0 siblings, 1 reply; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 18:10 UTC (permalink / raw)
To: Luck, Tony; +Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
On Fri, 2009-05-01 at 10:51 -0700, Luck, Tony wrote:
> > diff -puN include/asm-generic/ptemap.h~asm-generic-ptemap-h-highpte include/asm-generic/ptemap.h
> > +#ifdef CONFIG_HIGHPTE
> > +#include <asm/highmem.h>
> > +#define pte_offset_map(dir, address) \
> > + ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE0) + pte_index(address))
> > +#define pte_offset_map_nested(dir, address) \
> > + ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE1) + pte_index(address))
> > +#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
> > +#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
> > +
> > +#else /* !CONFIG_HIGHPTE */
> > +
> > #define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
> > #define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
> > #define pte_unmap(pte) do { } while (0)
>
> You need to add a closing #endif here.
Fixed, thanks.
-- Dave
^ permalink raw reply [flat|nested] 51+ messages in thread
* RE: [RFC][PATCH 33/35] asm-generic/ptemap.h for HIGHPTE users
2009-05-01 18:10 ` Dave Hansen
@ 2009-05-01 18:29 ` Luck, Tony
2009-05-01 18:32 ` Dave Hansen
0 siblings, 1 reply; 51+ messages in thread
From: Luck, Tony @ 2009-05-01 18:29 UTC (permalink / raw)
To: Dave Hansen; +Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
>> You need to add a closing #endif here.
>
> Fixed, thanks.
ia64 build fails with:
arch/ia64/mm/init.c: In function 'put_kernel_page':
arch/ia64/mm/init.c:248: error: implicit declaration of function 'pte_alloc_kernel'
arch/ia64/mm/init.c:248: warning: assignment makes pointer from integer without a cast
make[1]: *** [arch/ia64/mm/init.o] Error 1
Which I fixed by adding a #include <linux/ptemap.h> to init.c
-Tony
^ permalink raw reply [flat|nested] 51+ messages in thread
* RE: [RFC][PATCH 33/35] asm-generic/ptemap.h for HIGHPTE users
2009-05-01 18:29 ` Luck, Tony
@ 2009-05-01 18:32 ` Dave Hansen
0 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-01 18:32 UTC (permalink / raw)
To: Luck, Tony; +Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
On Fri, 2009-05-01 at 11:29 -0700, Luck, Tony wrote:
> >> You need to add a closing #endif here.
> > Fixed, thanks.
>
> ia64 build fails with:
>
> arch/ia64/mm/init.c: In function 'put_kernel_page':
> arch/ia64/mm/init.c:248: error: implicit declaration of function 'pte_alloc_kernel'
> arch/ia64/mm/init.c:248: warning: assignment makes pointer from integer without a cast
> make[1]: *** [arch/ia64/mm/init.o] Error 1
>
> Which I fixed by adding a #include <linux/ptemap.h> to init.c
I need to get a working ia64 compiler. :)
I'll add that to my 'include linux/ptemap.h at all use sites' patch.
-- Dave
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [RFC][PATCH 17/35] sparc: create ptemap.h
2009-05-01 14:42 ` [RFC][PATCH 17/35] sparc: " Dave Hansen
@ 2009-05-02 7:02 ` Daniel K.
2009-05-02 21:42 ` Dave Hansen
0 siblings, 1 reply; 51+ messages in thread
From: Daniel K. @ 2009-05-02 7:02 UTC (permalink / raw)
To: Dave Hansen; +Cc: linux-arch, linux-kernel
Dave Hansen wrote:
> Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
> ---
>
> linux-2.6.git-dave/arch/sparc/include/asm/pgtable_32.h | 15 --------
> linux-2.6.git-dave/arch/sparc/include/asm/pgtable_64.h | 5 --
> linux-2.6.git-dave/arch/sparc/include/asm/ptemap.h | 29 +++++++++++++++++
> 3 files changed, 31 insertions(+), 18 deletions(-)
>
> diff -puN arch/sparc/include/asm/pgtable_32.h~sparc-ptemaph arch/sparc/include/asm/pgtable_32.h
> --- linux-2.6.git/arch/sparc/include/asm/pgtable_32.h~sparc-ptemaph 2009-04-30 15:11:02.000000000 -0700
> +++ linux-2.6.git-dave/arch/sparc/include/asm/pgtable_32.h 2009-04-30 15:11:02.000000000 -0700
> @@ -300,20 +300,7 @@ BTFIXUPDEF_CALL(pmd_t *, pmd_offset, pgd
> BTFIXUPDEF_CALL(pte_t *, pte_offset_kernel, pmd_t *, unsigned long)
> #define pte_offset_kernel(dir,addr) BTFIXUP_CALL(pte_offset_kernel)(dir,addr)
>
> -/*
> - * This shortcut works on sun4m (and sun4d) because the nocache area is static,
> - * and sun4c is guaranteed to have no highmem anyway.
> - */
> -#define pte_offset_map(d, a) pte_offset_kernel(d,a)
> -#define pte_offset_map_nested(d, a) pte_offset_kernel(d,a)
> -
> -#define pte_unmap(pte) do{}while(0)
> -#define pte_unmap_nested(pte) do{}while(0)
> -
> -/* Certain architectures need to do special things when pte's
> - * within a page table are directly modified. Thus, the following
> - * hook is made available.
> - */
This is FUBAR'ed, The comment refers to the BTFIXUPDEF_CALL below, and should not
be moved to asm/ptemap.h
> +#include <asm/ptemap.h>
>
> BTFIXUPDEF_CALL(void, set_pte, pte_t *, pte_t)
>
> diff -puN arch/sparc/include/asm/pgtable_64.h~sparc-ptemaph arch/sparc/include/asm/pgtable_64.h
> --- linux-2.6.git/arch/sparc/include/asm/pgtable_64.h~sparc-ptemaph 2009-04-30 15:11:02.000000000 -0700
> +++ linux-2.6.git-dave/arch/sparc/include/asm/pgtable_64.h 2009-04-30 15:11:02.000000000 -0700
> @@ -652,10 +652,7 @@ static inline int pte_special(pte_t pte)
> /* Find an entry in the third-level page table.. */
> #define pte_offset_kernel(dir, address) \
> ((pte_t *)pmd_page_vaddr(*(dir)) + pte_index(address))
> -#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
> -#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
> -#define pte_unmap(pte) do { } while (0)
> -#define pte_unmap_nested(pte) do { } while (0)
> +#include <asm/ptemap.h>
>
> /* Actual page table PTE updates. */
> extern void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t orig);
> diff -puN /dev/null arch/sparc/include/asm/ptemap.h
> --- /dev/null 2008-09-02 09:40:19.000000000 -0700
> +++ linux-2.6.git-dave/arch/sparc/include/asm/ptemap.h 2009-04-30 15:11:02.000000000 -0700
> @@ -0,0 +1,29 @@
> +#ifndef _SPARC_ASM_PTEMAP_H
> +#define _SPARC_ASM_PTEMAP_H
> +
> +#if defined(__sparc__) && defined(__arch64__)
> +
> +/* Certain architectures need to do special things when pte's
> + * within a page table are directly modified. Thus, the following
> + * hook is made available.
> + */
> +
> +#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
> +#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
> +#define pte_unmap(pte) do { } while (0)
> +#define pte_unmap_nested(pte) do { } while (0)
> +
> +#else
> +
> + * This shortcut works on sun4m (and sun4d) because the nocache area is static,
> + * and sun4c is guaranteed to have no highmem anyway.
> + */
Broken comment.
> +#define pte_offset_map(d, a) pte_offset_kernel(d,a)
> +#define pte_offset_map_nested(d, a) pte_offset_kernel(d,a)
> +
> +#define pte_unmap(pte) do{}while(0)
> +#define pte_unmap_nested(pte) do{}while(0)
> +
> +#endif
> +
> +#endif /* _SPARC_ASM_PTEMAP_H *//*
Broken comment.
I realize this is going away in the end, but all the interim steps should
compile, to aid bisection.
Daniel K.
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [RFC][PATCH 13/35] parisc: create ptemap.h
2009-05-01 14:42 ` [RFC][PATCH 13/35] parisc: " Dave Hansen
@ 2009-05-02 14:29 ` Kyle McMartin
2009-05-02 21:45 ` Dave Hansen
0 siblings, 1 reply; 51+ messages in thread
From: Kyle McMartin @ 2009-05-02 14:29 UTC (permalink / raw)
To: Dave Hansen; +Cc: linux-arch, linux-kernel
On Fri, May 01, 2009 at 07:42:21AM -0700, Dave Hansen wrote:
> +#ifndef _PARISC_ASM_PTEMAP_H
> +#define _PARISC_ASM_PTEMAP_H
> +
> +#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
> +#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
> +#define pte_unmap(pte) do { } while (0)
> +#define pte_unmap_nested(pte) do { } while (0)
> +
> +#define pte_unmap(pte) do { } while (0)
> +#define pte_unmap_nested(pte) do { } while (0)
> +
> +#endif /* _PARISC_ASM_PTEMAP_H */
You have duplicate definitiosn of pte_unmap{,_nested}?
cheers, Kyle
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [RFC][PATCH 17/35] sparc: create ptemap.h
2009-05-02 7:02 ` Daniel K.
@ 2009-05-02 21:42 ` Dave Hansen
0 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-02 21:42 UTC (permalink / raw)
To: Daniel K.; +Cc: linux-arch, linux-kernel
On Sat, 2009-05-02 at 07:02 +0000, Daniel K. wrote:
> Dave Hansen wrote:
> > -/* Certain architectures need to do special things when pte's
> > - * within a page table are directly modified. Thus, the following
> > - * hook is made available.
> > - */
>
> This is FUBAR'ed, The comment refers to the BTFIXUPDEF_CALL below, and should not
> be moved to asm/ptemap.h
Thanks for looking through this. I've fixed this up in my most recent
version.
> > + * This shortcut works on sun4m (and sun4d) because the nocache area is static,
> > + * and sun4c is guaranteed to have no highmem anyway.
> > + */
>
> Broken comment.
>
> > +#define pte_offset_map(d, a) pte_offset_kernel(d,a)
> > +#define pte_offset_map_nested(d, a) pte_offset_kernel(d,a)
> > +
> > +#define pte_unmap(pte) do{}while(0)
> > +#define pte_unmap_nested(pte) do{}while(0)
> > +
> > +#endif
> > +
> > +#endif /* _SPARC_ASM_PTEMAP_H *//*
>
> Broken comment.
>
> I realize this is going away in the end, but all the interim steps should
> compile, to aid bisection.
Yup, absolutely. This is fixed up now, too.
-- Dave
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [RFC][PATCH 13/35] parisc: create ptemap.h
2009-05-02 14:29 ` Kyle McMartin
@ 2009-05-02 21:45 ` Dave Hansen
0 siblings, 0 replies; 51+ messages in thread
From: Dave Hansen @ 2009-05-02 21:45 UTC (permalink / raw)
To: Kyle McMartin; +Cc: linux-arch, linux-kernel
On Sat, 2009-05-02 at 10:29 -0400, Kyle McMartin wrote:
> On Fri, May 01, 2009 at 07:42:21AM -0700, Dave Hansen wrote:
> > +#ifndef _PARISC_ASM_PTEMAP_H
> > +#define _PARISC_ASM_PTEMAP_H
> > +
> > +#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
> > +#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
> > +#define pte_unmap(pte) do { } while (0)
> > +#define pte_unmap_nested(pte) do { } while (0)
> > +
> > +#define pte_unmap(pte) do { } while (0)
> > +#define pte_unmap_nested(pte) do { } while (0)
> > +
> > +#endif /* _PARISC_ASM_PTEMAP_H */
>
> You have duplicate definitiosn of pte_unmap{,_nested}?
Heh. I actually just copied this verbatim from the existing parisc
header. It already had a duplicate. :)
Anyway, I've made sure not to copy the dup and added a note in the patch
description so that it is much more clear. I'll show up in the next
post. Thanks for the review!
-- Dave
^ permalink raw reply [flat|nested] 51+ messages in thread
* Re: [RFC][PATCH 34/35] powerpc use generic ptemap.h
2009-05-01 14:42 ` [RFC][PATCH 34/35] powerpc use generic ptemap.h Dave Hansen
2009-05-01 17:46 ` Christoph Hellwig
@ 2009-05-17 3:55 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 51+ messages in thread
From: Benjamin Herrenschmidt @ 2009-05-17 3:55 UTC (permalink / raw)
To: Dave Hansen; +Cc: linux-arch, linux-kernel, Kumar Gala
On Fri, 2009-05-01 at 07:42 -0700, Dave Hansen wrote:
> powerpc is a bid of an oddball here. It seems to have CONFIG_HIGHPTE
> behavior at all times when compiled as 32-bit. There's even an
> #ifdef CONFIG_HIGHPTE in arch/powerpc/mm/pgtable_32.c, but there's no
> trace of HIGHPTE in Kconfig anywhere.
>
> This gives ppc32 an explicit HIGHPTE in Kconfig so that we can use
> the #ifdef in asm-generic/ptemap.h and let ppc use the generic code
> with x86 and frv.
With a bit of lag as I was away...
> +config HIGHPTE
> + def_bool y
> + depends on HIGHMEM
> +
Make this a selectable option and mark it EXPERIMENTAL or something. I
wouldn't be surprised if some of our stuff bitrotted. Also I very much
doubt BookE 32-bit will cope with HIGHPTE since the TLB miss code runs
in virtual mode with only the linear mapping guaranteed to be available
and it's not re-entrant.
So at the very least, make it depends on 6xx and also mark it
EXPERIMENTAL.
Also, iirc (I'll have to dbl check), our recent changes to enable
freeing of PTE pages using RCU may have broken HIGHPTE due to abuse of
page_address() on PTE pages. Nothing unfixable but another reason not to
unconditionally enable it.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 51+ messages in thread
end of thread, other threads:[~2009-05-17 3:55 UTC | newest]
Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 01/35] rename arm and frv's __pte_index() Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 02/35] rework sparc pte functions to be consistent with other arches Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 03/35] alpha: create ptemap.h Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 04/35] arm: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 05/35] avr32: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 06/35] cris: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 07/35] frv: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 08/35] ia64: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 09/35] m32r: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 10/35] m68k: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 11/35] mips: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 12/35] mn10300: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 13/35] parisc: " Dave Hansen
2009-05-02 14:29 ` Kyle McMartin
2009-05-02 21:45 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 14/35] powerpc: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 15/35] s390: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 16/35] sh: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 17/35] sparc: " Dave Hansen
2009-05-02 7:02 ` Daniel K.
2009-05-02 21:42 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 18/35] um: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 19/35] x86: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 20/35] xtensa: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 21/35] create linux/ptemap.h for arch-independent pte mapping funcs Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 22/35] include linux/ptemap.h at all use sites Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 23/35] factor x86 pte mapping code Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 24/35] arm: use pte_offset_kernel() as base for pte_offset_map*() Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 25/35] cris: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 26/35] frv: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 27/35] m32r: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 28/35] mips: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 29/35] um: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 30/35] m68k: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 31/35] mn10300: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 32/35] Move users to asm-generic/ptemap.h Dave Hansen
2009-05-01 17:43 ` Christoph Hellwig
2009-05-01 18:08 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 33/35] asm-generic/ptemap.h for HIGHPTE users Dave Hansen
2009-05-01 17:51 ` Luck, Tony
2009-05-01 18:10 ` Dave Hansen
2009-05-01 18:29 ` Luck, Tony
2009-05-01 18:32 ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 34/35] powerpc use generic ptemap.h Dave Hansen
2009-05-01 17:46 ` Christoph Hellwig
2009-05-01 17:58 ` Dave Hansen
2009-05-17 3:55 ` Benjamin Herrenschmidt
2009-05-01 14:42 ` [RFC][PATCH 35/35] remove old ptemap.h includes Dave Hansen
2009-05-01 14:59 ` Ingo Molnar
2009-05-01 15:02 ` Dave Hansen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).