[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Optimize the Linux arch xen implementation of "set_pte_at".



# HG changeset patch
# User iap10@xxxxxxxxxxxxxxxxxxxxx
# Node ID 08d19da852c73c82eaa8c87b741d22adbcf9a710
# Parent  a8a88f85a3e6cdf7548747292df0f68718e86bd4
Optimize the Linux arch xen implementation of "set_pte_at". 
Signed-off-by: ian@xxxxxxxxxxxxx

diff -r a8a88f85a3e6 -r 08d19da852c7 
linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h    Sat Aug 
13 21:01:35 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h    Sat Aug 
13 21:26:49 2005
@@ -14,7 +14,17 @@
  * hook is made available.
  */
 #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
-#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
+
+inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
+                      pte_t *ptep, pte_t val )
+{
+    if ( ((mm != current->mm) && (mm != &init_mm)) ||
+        HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
+    {
+        set_pte(ptep, val);
+    }
+}
+
 #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
 
 #ifndef CONFIG_XEN_SHADOW_MODE
diff -r a8a88f85a3e6 -r 08d19da852c7 
linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h    Sat Aug 
13 21:01:35 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h    Sat Aug 
13 21:26:49 2005
@@ -68,7 +68,16 @@
                xen_l1_entry_update((pteptr), (pteval))
 # define set_pte_atomic(pteptr,pteval) set_pte(pteptr,pteval)
 #endif
-#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
+
+inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
+                      pte_t *ptep, pte_t val )
+{
+    if ( ((mm != current->mm) && (mm != &init_mm)) ||
+        HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
+    {
+        set_pte(ptep, val);
+    }
+}
 
 #ifdef CONFIG_XEN_SHADOW_MODE
 # define set_pmd(pmdptr,pmdval) \
diff -r a8a88f85a3e6 -r 08d19da852c7 
linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h Sat Aug 13 
21:01:35 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h Sat Aug 13 
21:26:49 2005
@@ -265,7 +265,16 @@
        val &= ~(_PAGE_USER | _PAGE_DIRTY); 
        return val & ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED);      
 } 
-#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
+
+inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
+                      pte_t *ptep, pte_t val )
+{
+    if ( ((mm != current->mm) && (mm != &init_mm)) ||
+        HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
+    {
+        set_pte(ptep, val);
+    }
+}
 
 #define pte_none(x)    (!(x).pte)
 #define pte_present(x) ((x).pte & (_PAGE_PRESENT | _PAGE_PROTNONE))

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.