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-merge

[Xen-merge] [PATCH 12/23] pgalloc subarch headers

To: xen-merge@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-merge] [PATCH 12/23] pgalloc subarch headers
From: Chris Wright <chrisw@xxxxxxxx>
Date: Mon, 08 Aug 2005 00:02:48 -0700
Delivery-date: Mon, 08 Aug 2005 07:07:12 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-merge-request@lists.xensource.com?subject=help>
List-id: xen-merge <xen-merge.lists.xensource.com>
List-post: <mailto:xen-merge@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-merge>, <mailto:xen-merge-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-merge>, <mailto:xen-merge-request@lists.xensource.com?subject=unsubscribe>
References: <20050808070236.231405000@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-merge-bounces@xxxxxxxxxxxxxxxxxxx
--- linux-2.6.12-xen0-arch.orig/include/asm-i386/pgalloc.h
+++ linux-2.6.12-xen0-arch/include/asm-i386/pgalloc.h
@@ -6,13 +6,13 @@
 #include <linux/threads.h>
 #include <linux/mm.h>          /* for struct page */
 
+#include <mach_pgalloc.h>
+
 #define pmd_populate_kernel(mm, pmd, pte) \
                set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
 
-#define pmd_populate(mm, pmd, pte)                             \
-       set_pmd(pmd, __pmd(_PAGE_TABLE +                        \
-               ((unsigned long long)page_to_pfn(pte) <<        \
-                       (unsigned long long) PAGE_SHIFT)))
+#define pmd_populate(mm, pmd, pte)     mach_pmd_populate(mm, pmd, pte)
+
 /*
  * Allocate and free page tables.
  */
@@ -24,12 +24,12 @@ extern struct page *pte_alloc_one(struct
 
 static inline void pte_free_kernel(pte_t *pte)
 {
-       free_page((unsigned long)pte);
+       mach_pte_free_kernel(pte);
 }
 
 static inline void pte_free(struct page *pte)
 {
-       __free_page(pte);
+       mach_pte_free(pte);
 }
 
 
--- /dev/null
+++ linux-2.6.12-xen0-arch/include/asm-i386/mach-default/mach_pgalloc.h
@@ -0,0 +1,15 @@
+#ifndef _ASM_MACH_PGALLOC_H
+#define _ASM_MACH_PGALLOC_H
+
+#define mach_pmd_populate(mm, pmd, pte)                        \
+       set_pmd(pmd, __pmd(_PAGE_TABLE +                        \
+               ((unsigned long long)page_to_pfn(pte) <<        \
+                       (unsigned long long) PAGE_SHIFT)))
+/*
+ * free page tables
+ */
+#define mach_pte_free_kernel(_pte) free_page((unsigned long)_pte)
+
+#define mach_pte_free(_pte) __free_page(_pte)
+
+#endif 
--- linux-2.6.12-xen0/include/asm-i386/mach-xen/mach_pgalloc.h  1969-12-31 
16:00:00.000000000 -0800
+++ linux-2.6.12-xen0-arch/include/asm-i386/mach-xen/mach_pgalloc.h     
2005-08-02 21:26:41.000000000 -0700
@@ -0,0 +1,31 @@
+#ifndef _ASM_MACH_PGALLOC_H
+#define _ASM_MACH_PGALLOC_H
+
+#define mach_pmd_populate(mm, pmd, pte)                                \
+do {                                                                   \
+       if (unlikely((mm)->context.pinned)) {                           \
+               if (!PageHighMem(pte))                                  \
+                       HYPERVISOR_update_va_mapping(                   \
+                         (unsigned long)__va(page_to_pfn(pte)<<PAGE_SHIFT),\
+                         pfn_pte(page_to_pfn(pte), PAGE_KERNEL_RO), 0);\
+               set_pmd(pmd, __pmd(_PAGE_TABLE +                        \
+                       ((unsigned long long)page_to_pfn(pte) <<        \
+                               (unsigned long long) PAGE_SHIFT)));     \
+       } else {                                                        \
+               *(pmd) = __pmd(_PAGE_TABLE +                            \
+                       ((unsigned long long)page_to_pfn(pte) <<        \
+                               (unsigned long long) PAGE_SHIFT));      \
+       }                                                               \
+} while (0)
+
+/*
+ * free page tables
+ */
+#define mach_pte_free_kernel(_pte)             \
+       free_page((unsigned long)_pte);         \
+       make_page_writable(_pte)
+
+void _pte_free(struct page *pte);
+#define mach_pte_free(_pte) _pte_free(_pte)
+
+#endif 

--


_______________________________________________
Xen-merge mailing list
Xen-merge@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-merge