direct-io.hg

changeset 4368:7d66265be1c5

bitkeeper revision 1.1236.1.150 (42492cd6FsZ7ND8m7q_7T91GL1KcMA)

Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk
author kaf24@firebug.cl.cam.ac.uk
date Tue Mar 29 10:24:22 2005 +0000 (2005-03-29)
parents fedff27be9eb 96bece6d7b61
children 6244d80c59e5
files linux-2.4.29-xen-sparse/arch/xen/kernel/traps.c linux-2.4.29-xen-sparse/include/asm-xen/desc.h linux-2.4.29-xen-sparse/include/asm-xen/pgalloc.h linux-2.4.29-xen-sparse/include/asm-xen/pgtable.h linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c linux-2.6.11-xen-sparse/arch/xen/i386/mm/pgtable.c linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
line diff
     1.1 --- a/linux-2.4.29-xen-sparse/arch/xen/kernel/traps.c	Tue Mar 29 10:01:06 2005 +0000
     1.2 +++ b/linux-2.4.29-xen-sparse/arch/xen/kernel/traps.c	Tue Mar 29 10:24:22 2005 +0000
     1.3 @@ -623,7 +623,6 @@ void __init trap_init(void)
     1.4      set_call_gate(&default_ldt[0],lcall7);
     1.5      set_call_gate(&default_ldt[4],lcall27);
     1.6      __make_page_readonly(&default_ldt[0]);
     1.7 -    flush_page_update_queue();
     1.8  
     1.9      cpu_init();
    1.10  }
     2.1 --- a/linux-2.4.29-xen-sparse/include/asm-xen/desc.h	Tue Mar 29 10:01:06 2005 +0000
     2.2 +++ b/linux-2.4.29-xen-sparse/include/asm-xen/desc.h	Tue Mar 29 10:24:22 2005 +0000
     2.3 @@ -16,15 +16,6 @@ struct Xgt_desc_struct {
     2.4  
     2.5  extern struct desc_struct default_ldt[];
     2.6  
     2.7 -static inline void clear_LDT(void)
     2.8 -{
     2.9 -    /*
    2.10 -     * NB. We load the default_ldt for lcall7/27 handling on demand, as
    2.11 -     * it slows down context switching. Noone uses it anyway.
    2.12 -     */
    2.13 -    queue_set_ldt(0, 0);
    2.14 -}
    2.15 -
    2.16  static inline void load_LDT(mm_context_t *pc)
    2.17  {
    2.18      void *segments = pc->ldt;
    2.19 @@ -33,7 +24,7 @@ static inline void load_LDT(mm_context_t
    2.20      if ( count == 0 )
    2.21          segments = NULL;
    2.22      
    2.23 -    queue_set_ldt((unsigned long)segments, count);               
    2.24 +    xen_set_ldt((unsigned long)segments, count);               
    2.25  }
    2.26  
    2.27  #endif /* __ASSEMBLY__ */
     3.1 --- a/linux-2.4.29-xen-sparse/include/asm-xen/pgalloc.h	Tue Mar 29 10:01:06 2005 +0000
     3.2 +++ b/linux-2.4.29-xen-sparse/include/asm-xen/pgalloc.h	Tue Mar 29 10:24:22 2005 +0000
     3.3 @@ -79,8 +79,7 @@ static inline pgd_t *get_pgd_slow(void)
     3.4  			init_mm.pgd + USER_PTRS_PER_PGD,
     3.5  			(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
     3.6  		__make_page_readonly(pgd);
     3.7 -		queue_pgd_pin(__pa(pgd));
     3.8 -		flush_page_update_queue();
     3.9 +		xen_pgd_pin(__pa(pgd));
    3.10  	}
    3.11  	return pgd;
    3.12  }
    3.13 @@ -110,9 +109,8 @@ static inline void free_pgd_slow(pgd_t *
    3.14  		free_page((unsigned long)__va(pgd_val(pgd[i])-1));
    3.15  	kmem_cache_free(pae_pgd_cachep, pgd);
    3.16  #else
    3.17 -	queue_pgd_unpin(__pa(pgd));
    3.18 +	xen_pgd_unpin(__pa(pgd));
    3.19  	__make_page_writable(pgd);
    3.20 -	flush_page_update_queue();
    3.21  	free_page((unsigned long)pgd);
    3.22  #endif
    3.23  }
    3.24 @@ -135,8 +133,7 @@ static inline pte_t *pte_alloc_one(struc
    3.25      {
    3.26          clear_page(pte);
    3.27          __make_page_readonly(pte);
    3.28 -        queue_pte_pin(__pa(pte));
    3.29 -        flush_page_update_queue();
    3.30 +        xen_pte_pin(__pa(pte));
    3.31      }
    3.32      return pte;
    3.33  
    3.34 @@ -155,9 +152,8 @@ static inline pte_t *pte_alloc_one_fast(
    3.35  
    3.36  static __inline__ void pte_free_slow(pte_t *pte)
    3.37  {
    3.38 -    queue_pte_unpin(__pa(pte));
    3.39 +    xen_pte_unpin(__pa(pte));
    3.40      __make_page_writable(pte);
    3.41 -    flush_page_update_queue();
    3.42      free_page((unsigned long)pte);
    3.43  }
    3.44  
     4.1 --- a/linux-2.4.29-xen-sparse/include/asm-xen/pgtable.h	Tue Mar 29 10:01:06 2005 +0000
     4.2 +++ b/linux-2.4.29-xen-sparse/include/asm-xen/pgtable.h	Tue Mar 29 10:24:22 2005 +0000
     4.3 @@ -300,7 +300,7 @@ static inline void __make_page_readonly(
     4.4      pgd_t *pgd = pgd_offset_k((unsigned long)va);
     4.5      pmd_t *pmd = pmd_offset(pgd, (unsigned long)va);
     4.6      pte_t *pte = pte_offset(pmd, (unsigned long)va);
     4.7 -    queue_l1_entry_update(pte, (*(unsigned long *)pte)&~_PAGE_RW);
     4.8 +    set_pte(pte, pte_wrprotect(*pte));
     4.9  }
    4.10  
    4.11  static inline void __make_page_writable(void *va)
    4.12 @@ -308,7 +308,7 @@ static inline void __make_page_writable(
    4.13      pgd_t *pgd = pgd_offset_k((unsigned long)va);
    4.14      pmd_t *pmd = pmd_offset(pgd, (unsigned long)va);
    4.15      pte_t *pte = pte_offset(pmd, (unsigned long)va);
    4.16 -    queue_l1_entry_update(pte, (*(unsigned long *)pte)|_PAGE_RW);
    4.17 +    set_pte(pte, pte_mkwrite(*pte));
    4.18  }
    4.19  
    4.20  static inline void make_page_readonly(void *va)
    4.21 @@ -316,7 +316,7 @@ static inline void make_page_readonly(vo
    4.22      pgd_t *pgd = pgd_offset_k((unsigned long)va);
    4.23      pmd_t *pmd = pmd_offset(pgd, (unsigned long)va);
    4.24      pte_t *pte = pte_offset(pmd, (unsigned long)va);
    4.25 -    queue_l1_entry_update(pte, (*(unsigned long *)pte)&~_PAGE_RW);
    4.26 +    set_pte(pte, pte_wrprotect(*pte));
    4.27      if ( (unsigned long)va >= VMALLOC_START )
    4.28          __make_page_readonly(machine_to_virt(
    4.29              *(unsigned long *)pte&PAGE_MASK));
    4.30 @@ -327,7 +327,7 @@ static inline void make_page_writable(vo
    4.31      pgd_t *pgd = pgd_offset_k((unsigned long)va);
    4.32      pmd_t *pmd = pmd_offset(pgd, (unsigned long)va);
    4.33      pte_t *pte = pte_offset(pmd, (unsigned long)va);
    4.34 -    queue_l1_entry_update(pte, (*(unsigned long *)pte)|_PAGE_RW);
    4.35 +    set_pte(pte, pte_mkwrite(*pte));
    4.36      if ( (unsigned long)va >= VMALLOC_START )
    4.37          __make_page_writable(machine_to_virt(
    4.38              *(unsigned long *)pte&PAGE_MASK));
     5.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c	Tue Mar 29 10:01:06 2005 +0000
     5.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c	Tue Mar 29 10:24:22 2005 +0000
     5.3 @@ -355,11 +355,12 @@ static void __init pagetable_init (void)
     5.4  	 */
     5.5  	memcpy(new_pgd, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
     5.6  	make_page_readonly(new_pgd);
     5.7 -	queue_pgd_pin(__pa(new_pgd));
     5.8 +	xen_pgd_pin(__pa(new_pgd));
     5.9  	load_cr3(new_pgd);
    5.10 -	queue_pgd_unpin(__pa(old_pgd));
    5.11 +	flush_page_update_queue();
    5.12 +	xen_pgd_unpin(__pa(old_pgd));
    5.13  	make_page_writable(old_pgd);
    5.14 -	__flush_tlb_all(); /* implicit flush */
    5.15 +	__flush_tlb_all();
    5.16  	free_bootmem(__pa(old_pgd), PAGE_SIZE);
    5.17  
    5.18  	kernel_physical_mapping_init(new_pgd);
     6.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/mm/pgtable.c	Tue Mar 29 10:01:06 2005 +0000
     6.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/mm/pgtable.c	Tue Mar 29 10:24:22 2005 +0000
     6.3 @@ -193,10 +193,8 @@ void __set_fixmap_ma (enum fixed_address
     6.4  pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
     6.5  {
     6.6  	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
     6.7 -	if (pte) {
     6.8 +	if (pte)
     6.9  		make_page_readonly(pte);
    6.10 -		flush_page_update_queue();
    6.11 -	}
    6.12  	return pte;
    6.13  }
    6.14  
    6.15 @@ -208,8 +206,7 @@ void pte_ctor(void *pte, kmem_cache_t *c
    6.16  
    6.17  	clear_page(pte);
    6.18  	make_page_readonly(pte);
    6.19 -	queue_pte_pin(__pa(pte));
    6.20 -	flush_page_update_queue();
    6.21 +	xen_pte_pin(__pa(pte));
    6.22  }
    6.23  
    6.24  void pte_dtor(void *pte, kmem_cache_t *cache, unsigned long unused)
    6.25 @@ -217,9 +214,8 @@ void pte_dtor(void *pte, kmem_cache_t *c
    6.26  	struct page *page = virt_to_page(pte);
    6.27  	ClearPageForeign(page);
    6.28  
    6.29 -	queue_pte_unpin(__pa(pte));
    6.30 +	xen_pte_unpin(__pa(pte));
    6.31  	make_page_writable(pte);
    6.32 -	flush_page_update_queue();
    6.33  }
    6.34  
    6.35  struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
    6.36 @@ -316,8 +312,7 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
    6.37  	memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
    6.38   out:
    6.39  	make_page_readonly(pgd);
    6.40 -	queue_pgd_pin(__pa(pgd));
    6.41 -	flush_page_update_queue();
    6.42 +	xen_pgd_pin(__pa(pgd));
    6.43  }
    6.44  
    6.45  /* never called when PTRS_PER_PMD > 1 */
    6.46 @@ -325,9 +320,8 @@ void pgd_dtor(void *pgd, kmem_cache_t *c
    6.47  {
    6.48  	unsigned long flags; /* can be called from interrupt context */
    6.49  
    6.50 -	queue_pgd_unpin(__pa(pgd));
    6.51 +	xen_pgd_unpin(__pa(pgd));
    6.52  	make_page_writable(pgd);
    6.53 -	flush_page_update_queue();
    6.54  
    6.55  	if (PTRS_PER_PMD > 1)
    6.56  		return;
    6.57 @@ -378,7 +372,7 @@ void make_lowmem_page_readonly(void *va)
    6.58  	pud_t *pud = pud_offset(pgd, (unsigned long)va);
    6.59  	pmd_t *pmd = pmd_offset(pud, (unsigned long)va);
    6.60  	pte_t *pte = pte_offset_kernel(pmd, (unsigned long)va);
    6.61 -	queue_l1_entry_update(pte, (*(unsigned long *)pte)&~_PAGE_RW);
    6.62 +	set_pte(pte, pte_wrprotect(*pte));
    6.63  }
    6.64  
    6.65  void make_lowmem_page_writable(void *va)
    6.66 @@ -387,7 +381,7 @@ void make_lowmem_page_writable(void *va)
    6.67  	pud_t *pud = pud_offset(pgd, (unsigned long)va);
    6.68  	pmd_t *pmd = pmd_offset(pud, (unsigned long)va);
    6.69  	pte_t *pte = pte_offset_kernel(pmd, (unsigned long)va);
    6.70 -	queue_l1_entry_update(pte, (*(unsigned long *)pte)|_PAGE_RW);
    6.71 +	set_pte(pte, pte_mkwrite(*pte));
    6.72  }
    6.73  
    6.74  void make_page_readonly(void *va)
    6.75 @@ -396,7 +390,7 @@ void make_page_readonly(void *va)
    6.76  	pud_t *pud = pud_offset(pgd, (unsigned long)va);
    6.77  	pmd_t *pmd = pmd_offset(pud, (unsigned long)va);
    6.78  	pte_t *pte = pte_offset_kernel(pmd, (unsigned long)va);
    6.79 -	queue_l1_entry_update(pte, (*(unsigned long *)pte)&~_PAGE_RW);
    6.80 +	set_pte(pte, pte_wrprotect(*pte));
    6.81  	if ( (unsigned long)va >= (unsigned long)high_memory )
    6.82  	{
    6.83  		unsigned long phys;
    6.84 @@ -414,7 +408,7 @@ void make_page_writable(void *va)
    6.85  	pud_t *pud = pud_offset(pgd, (unsigned long)va);
    6.86  	pmd_t *pmd = pmd_offset(pud, (unsigned long)va);
    6.87  	pte_t *pte = pte_offset_kernel(pmd, (unsigned long)va);
    6.88 -	queue_l1_entry_update(pte, (*(unsigned long *)pte)|_PAGE_RW);
    6.89 +	set_pte(pte, pte_mkwrite(*pte));
    6.90  	if ( (unsigned long)va >= (unsigned long)high_memory )
    6.91  	{
    6.92  		unsigned long phys;
     7.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Tue Mar 29 10:01:06 2005 +0000
     7.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Tue Mar 29 10:24:22 2005 +0000
     7.3 @@ -16,8 +16,6 @@
     7.4  #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
     7.5  #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
     7.6  #define set_pmd(pmdptr, pmdval) xen_l2_entry_update((pmdptr), (pmdval))
     7.7 -#define set_pte_batched(pteptr, pteval) \
     7.8 -	queue_l1_entry_update(pteptr, (pteval).pte_low)
     7.9  
    7.10  #define ptep_get_and_clear(xp)	__pte_ma(xchg(&(xp)->pte_low, 0))
    7.11  #define pte_same(a, b)		((a).pte_low == (b).pte_low)