WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 12 of 13] Pass the mm struct into the pgd_free code s

To: Andrew Morton <akpm@xxxxxxxx>
Subject: [Xen-devel] [PATCH 12 of 13] Pass the mm struct into the pgd_free code so the mm is available here
From: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx>
Date: Tue, 01 Aug 2006 13:00:50 -0700
Cc: Virtualization <virtualization@xxxxxxxx>, Zachary Amsden <zach@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx>, Hollis Blanchard <hollisb@xxxxxxxxxx>, Rusty Russell <rusty@xxxxxxxxxxxxxxx>, Linux Kernel <linux-kernel@xxxxxxxxxxxxxxx>, Chris Wright <chrisw@xxxxxxxxxxxx>, Ian Pratt <ian.pratt@xxxxxxxxxxxxx>, "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>, Gerd Hoffmann <kraxel@xxxxxxx>, Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>, Christoph Lameter <clameter@xxxxxxx>
Delivery-date: Tue, 01 Aug 2006 13:21:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1154462438@ezr>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>