[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 12 of 13] Pass the mm struct into the pgd_free code so the mm is available here
5 files changed, 10 insertions(+), 4 deletions(-) arch/i386/mm/pgtable.c | 3 ++- include/asm-i386/pgalloc.h | 4 ++-- include/asm-i386/pgtable.h | 1 + include/linux/mm.h | 4 ++++ kernel/fork.c | 2 +- Signed-off-by: Zachary Amsden <zach@xxxxxxxxxx> Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx> =================================================================== diff -r 398f8fd6b334 -r 8235caea9d68 arch/i386/mm/pgtable.c --- a/arch/i386/mm/pgtable.c Tue Aug 01 01:32:01 2006 -0700 +++ b/arch/i386/mm/pgtable.c Tue Aug 01 01:32:01 2006 -0700 @@ -275,9 +275,10 @@ out_oom: return NULL; } -void pgd_free(pgd_t *pgd) +void pgd_free(struct mm_struct *mm) { int i; + pgd_t *pgd = mm->pgd; /* in the PAE case user pgd entries are overwritten before usage */ if (PTRS_PER_PMD > 1) diff -r 398f8fd6b334 -r 8235caea9d68 include/asm-i386/pgalloc.h --- a/include/asm-i386/pgalloc.h Tue Aug 01 01:32:01 2006 -0700 +++ b/include/asm-i386/pgalloc.h Tue Aug 01 01:32:01 2006 -0700 @@ -3,7 +3,6 @@ #include <asm/fixmap.h> #include <linux/threads.h> -#include <linux/mm.h> /* for struct page */ #define pmd_populate_kernel(mm, pmd, pte) \ set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))) @@ -16,7 +15,8 @@ * Allocate and free page tables. */ extern pgd_t *pgd_alloc(struct mm_struct *); -extern void pgd_free(pgd_t *pgd); +extern void pgd_free(struct mm_struct *); +#define pgd_free_mm(mm) pgd_free(mm) extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); diff -r 398f8fd6b334 -r 8235caea9d68 include/asm-i386/pgtable.h --- a/include/asm-i386/pgtable.h Tue Aug 01 01:32:01 2006 -0700 +++ b/include/asm-i386/pgtable.h Tue Aug 01 01:32:01 2006 -0700 @@ -393,6 +393,7 @@ extern pte_t *lookup_address(unsigned lo extern void noexec_setup(const char *str); +#include <asm/pgalloc.h> #if defined(CONFIG_HIGHPTE) #define pte_offset_map(dir, address) \ ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE0) + pte_index(address)) diff -r 398f8fd6b334 -r 8235caea9d68 include/linux/mm.h --- a/include/linux/mm.h Tue Aug 01 01:32:01 2006 -0700 +++ b/include/linux/mm.h Tue Aug 01 01:32:01 2006 -0700 @@ -1077,5 +1077,9 @@ extern int randomize_va_space; const char *arch_vma_name(struct vm_area_struct *vma); +#ifndef pgd_free_mm +#define pgd_free_mm(mm) pgd_free((mm)->pgd) +#endif + #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ diff -r 398f8fd6b334 -r 8235caea9d68 kernel/fork.c --- a/kernel/fork.c Tue Aug 01 01:32:01 2006 -0700 +++ b/kernel/fork.c Tue Aug 01 01:32:01 2006 -0700 @@ -299,7 +299,7 @@ static inline int mm_alloc_pgd(struct mm static inline void mm_free_pgd(struct mm_struct * mm) { - pgd_free(mm->pgd); + pgd_free_mm(mm); } #else #define dup_mmap(mm, oldmm) (0) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |