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

[Xen-changelog] Get rid of more uses of batched mmu interface.



ChangeSet 1.1384.1.1, 2005/03/29 11:24:15+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Get rid of more uses of batched mmu interface.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 linux-2.4.29-xen-sparse/arch/xen/kernel/traps.c                   |    1 
 linux-2.4.29-xen-sparse/include/asm-xen/desc.h                    |   11 ----
 linux-2.4.29-xen-sparse/include/asm-xen/pgalloc.h                 |   12 +----
 linux-2.4.29-xen-sparse/include/asm-xen/pgtable.h                 |    8 +--
 linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c                   |    7 +-
 linux-2.6.11-xen-sparse/arch/xen/i386/mm/pgtable.c                |   24 
+++-------
 linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h |    2 
 7 files changed, 22 insertions(+), 43 deletions(-)


diff -Nru a/linux-2.4.29-xen-sparse/arch/xen/kernel/traps.c 
b/linux-2.4.29-xen-sparse/arch/xen/kernel/traps.c
--- a/linux-2.4.29-xen-sparse/arch/xen/kernel/traps.c   2005-03-29 06:03:45 
-05:00
+++ b/linux-2.4.29-xen-sparse/arch/xen/kernel/traps.c   2005-03-29 06:03:45 
-05:00
@@ -623,7 +623,6 @@
     set_call_gate(&default_ldt[0],lcall7);
     set_call_gate(&default_ldt[4],lcall27);
     __make_page_readonly(&default_ldt[0]);
-    flush_page_update_queue();
 
     cpu_init();
 }
diff -Nru a/linux-2.4.29-xen-sparse/include/asm-xen/desc.h 
b/linux-2.4.29-xen-sparse/include/asm-xen/desc.h
--- a/linux-2.4.29-xen-sparse/include/asm-xen/desc.h    2005-03-29 06:03:45 
-05:00
+++ b/linux-2.4.29-xen-sparse/include/asm-xen/desc.h    2005-03-29 06:03:45 
-05:00
@@ -16,15 +16,6 @@
 
 extern struct desc_struct default_ldt[];
 
-static inline void clear_LDT(void)
-{
-    /*
-     * NB. We load the default_ldt for lcall7/27 handling on demand, as
-     * it slows down context switching. Noone uses it anyway.
-     */
-    queue_set_ldt(0, 0);
-}
-
 static inline void load_LDT(mm_context_t *pc)
 {
     void *segments = pc->ldt;
@@ -33,7 +24,7 @@
     if ( count == 0 )
         segments = NULL;
     
-    queue_set_ldt((unsigned long)segments, count);               
+    xen_set_ldt((unsigned long)segments, count);               
 }
 
 #endif /* __ASSEMBLY__ */
diff -Nru a/linux-2.4.29-xen-sparse/include/asm-xen/pgalloc.h 
b/linux-2.4.29-xen-sparse/include/asm-xen/pgalloc.h
--- a/linux-2.4.29-xen-sparse/include/asm-xen/pgalloc.h 2005-03-29 06:03:45 
-05:00
+++ b/linux-2.4.29-xen-sparse/include/asm-xen/pgalloc.h 2005-03-29 06:03:45 
-05:00
@@ -79,8 +79,7 @@
                        init_mm.pgd + USER_PTRS_PER_PGD,
                        (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
                __make_page_readonly(pgd);
-               queue_pgd_pin(__pa(pgd));
-               flush_page_update_queue();
+               xen_pgd_pin(__pa(pgd));
        }
        return pgd;
 }
@@ -110,9 +109,8 @@
                free_page((unsigned long)__va(pgd_val(pgd[i])-1));
        kmem_cache_free(pae_pgd_cachep, pgd);
 #else
-       queue_pgd_unpin(__pa(pgd));
+       xen_pgd_unpin(__pa(pgd));
        __make_page_writable(pgd);
-       flush_page_update_queue();
        free_page((unsigned long)pgd);
 #endif
 }
@@ -135,8 +133,7 @@
     {
         clear_page(pte);
         __make_page_readonly(pte);
-        queue_pte_pin(__pa(pte));
-        flush_page_update_queue();
+        xen_pte_pin(__pa(pte));
     }
     return pte;
 
@@ -155,9 +152,8 @@
 
 static __inline__ void pte_free_slow(pte_t *pte)
 {
-    queue_pte_unpin(__pa(pte));
+    xen_pte_unpin(__pa(pte));
     __make_page_writable(pte);
-    flush_page_update_queue();
     free_page((unsigned long)pte);
 }
 
diff -Nru a/linux-2.4.29-xen-sparse/include/asm-xen/pgtable.h 
b/linux-2.4.29-xen-sparse/include/asm-xen/pgtable.h
--- a/linux-2.4.29-xen-sparse/include/asm-xen/pgtable.h 2005-03-29 06:03:45 
-05:00
+++ b/linux-2.4.29-xen-sparse/include/asm-xen/pgtable.h 2005-03-29 06:03:45 
-05:00
@@ -300,7 +300,7 @@
     pgd_t *pgd = pgd_offset_k((unsigned long)va);
     pmd_t *pmd = pmd_offset(pgd, (unsigned long)va);
     pte_t *pte = pte_offset(pmd, (unsigned long)va);
-    queue_l1_entry_update(pte, (*(unsigned long *)pte)&~_PAGE_RW);
+    set_pte(pte, pte_wrprotect(*pte));
 }
 
 static inline void __make_page_writable(void *va)
@@ -308,7 +308,7 @@
     pgd_t *pgd = pgd_offset_k((unsigned long)va);
     pmd_t *pmd = pmd_offset(pgd, (unsigned long)va);
     pte_t *pte = pte_offset(pmd, (unsigned long)va);
-    queue_l1_entry_update(pte, (*(unsigned long *)pte)|_PAGE_RW);
+    set_pte(pte, pte_mkwrite(*pte));
 }
 
 static inline void make_page_readonly(void *va)
@@ -316,7 +316,7 @@
     pgd_t *pgd = pgd_offset_k((unsigned long)va);
     pmd_t *pmd = pmd_offset(pgd, (unsigned long)va);
     pte_t *pte = pte_offset(pmd, (unsigned long)va);
-    queue_l1_entry_update(pte, (*(unsigned long *)pte)&~_PAGE_RW);
+    set_pte(pte, pte_wrprotect(*pte));
     if ( (unsigned long)va >= VMALLOC_START )
         __make_page_readonly(machine_to_virt(
             *(unsigned long *)pte&PAGE_MASK));
@@ -327,7 +327,7 @@
     pgd_t *pgd = pgd_offset_k((unsigned long)va);
     pmd_t *pmd = pmd_offset(pgd, (unsigned long)va);
     pte_t *pte = pte_offset(pmd, (unsigned long)va);
-    queue_l1_entry_update(pte, (*(unsigned long *)pte)|_PAGE_RW);
+    set_pte(pte, pte_mkwrite(*pte));
     if ( (unsigned long)va >= VMALLOC_START )
         __make_page_writable(machine_to_virt(
             *(unsigned long *)pte&PAGE_MASK));
diff -Nru a/linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c 
b/linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c
--- a/linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c   2005-03-29 06:03:45 
-05:00
+++ b/linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c   2005-03-29 06:03:45 
-05:00
@@ -355,11 +355,12 @@
         */
        memcpy(new_pgd, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
        make_page_readonly(new_pgd);
-       queue_pgd_pin(__pa(new_pgd));
+       xen_pgd_pin(__pa(new_pgd));
        load_cr3(new_pgd);
-       queue_pgd_unpin(__pa(old_pgd));
+       flush_page_update_queue();
+       xen_pgd_unpin(__pa(old_pgd));
        make_page_writable(old_pgd);
-       __flush_tlb_all(); /* implicit flush */
+       __flush_tlb_all();
        free_bootmem(__pa(old_pgd), PAGE_SIZE);
 
        kernel_physical_mapping_init(new_pgd);
diff -Nru a/linux-2.6.11-xen-sparse/arch/xen/i386/mm/pgtable.c 
b/linux-2.6.11-xen-sparse/arch/xen/i386/mm/pgtable.c
--- a/linux-2.6.11-xen-sparse/arch/xen/i386/mm/pgtable.c        2005-03-29 
06:03:45 -05:00
+++ b/linux-2.6.11-xen-sparse/arch/xen/i386/mm/pgtable.c        2005-03-29 
06:03:45 -05:00
@@ -193,10 +193,8 @@
 pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
        pte_t *pte = (pte_t 
*)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
-       if (pte) {
+       if (pte)
                make_page_readonly(pte);
-               flush_page_update_queue();
-       }
        return pte;
 }
 
@@ -208,8 +206,7 @@
 
        clear_page(pte);
        make_page_readonly(pte);
-       queue_pte_pin(__pa(pte));
-       flush_page_update_queue();
+       xen_pte_pin(__pa(pte));
 }
 
 void pte_dtor(void *pte, kmem_cache_t *cache, unsigned long unused)
@@ -217,9 +214,8 @@
        struct page *page = virt_to_page(pte);
        ClearPageForeign(page);
 
-       queue_pte_unpin(__pa(pte));
+       xen_pte_unpin(__pa(pte));
        make_page_writable(pte);
-       flush_page_update_queue();
 }
 
 struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
@@ -316,8 +312,7 @@
        memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
  out:
        make_page_readonly(pgd);
-       queue_pgd_pin(__pa(pgd));
-       flush_page_update_queue();
+       xen_pgd_pin(__pa(pgd));
 }
 
 /* never called when PTRS_PER_PMD > 1 */
@@ -325,9 +320,8 @@
 {
        unsigned long flags; /* can be called from interrupt context */
 
-       queue_pgd_unpin(__pa(pgd));
+       xen_pgd_unpin(__pa(pgd));
        make_page_writable(pgd);
-       flush_page_update_queue();
 
        if (PTRS_PER_PMD > 1)
                return;
@@ -378,7 +372,7 @@
        pud_t *pud = pud_offset(pgd, (unsigned long)va);
        pmd_t *pmd = pmd_offset(pud, (unsigned long)va);
        pte_t *pte = pte_offset_kernel(pmd, (unsigned long)va);
-       queue_l1_entry_update(pte, (*(unsigned long *)pte)&~_PAGE_RW);
+       set_pte(pte, pte_wrprotect(*pte));
 }
 
 void make_lowmem_page_writable(void *va)
@@ -387,7 +381,7 @@
        pud_t *pud = pud_offset(pgd, (unsigned long)va);
        pmd_t *pmd = pmd_offset(pud, (unsigned long)va);
        pte_t *pte = pte_offset_kernel(pmd, (unsigned long)va);
-       queue_l1_entry_update(pte, (*(unsigned long *)pte)|_PAGE_RW);
+       set_pte(pte, pte_mkwrite(*pte));
 }
 
 void make_page_readonly(void *va)
@@ -396,7 +390,7 @@
        pud_t *pud = pud_offset(pgd, (unsigned long)va);
        pmd_t *pmd = pmd_offset(pud, (unsigned long)va);
        pte_t *pte = pte_offset_kernel(pmd, (unsigned long)va);
-       queue_l1_entry_update(pte, (*(unsigned long *)pte)&~_PAGE_RW);
+       set_pte(pte, pte_wrprotect(*pte));
        if ( (unsigned long)va >= (unsigned long)high_memory )
        {
                unsigned long phys;
@@ -414,7 +408,7 @@
        pud_t *pud = pud_offset(pgd, (unsigned long)va);
        pmd_t *pmd = pmd_offset(pud, (unsigned long)va);
        pte_t *pte = pte_offset_kernel(pmd, (unsigned long)va);
-       queue_l1_entry_update(pte, (*(unsigned long *)pte)|_PAGE_RW);
+       set_pte(pte, pte_mkwrite(*pte));
        if ( (unsigned long)va >= (unsigned long)high_memory )
        {
                unsigned long phys;
diff -Nru a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h 
b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
--- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h 
2005-03-29 06:03:45 -05:00
+++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h 
2005-03-29 06:03:45 -05:00
@@ -16,8 +16,6 @@
 #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
 #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
 #define set_pmd(pmdptr, pmdval) xen_l2_entry_update((pmdptr), (pmdval))
-#define set_pte_batched(pteptr, pteval) \
-       queue_l1_entry_update(pteptr, (pteval).pte_low)
 
 #define ptep_get_and_clear(xp) __pte_ma(xchg(&(xp)->pte_low, 0))
 #define pte_same(a, b)         ((a).pte_low == (b).pte_low)

_______________________________________________
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®.