ia64/xen-unstable

changeset 1824:8dd08ab8931c

bitkeeper revision 1.1110 (40fba858q1HuMzljocVdGkLuG4dxfw)

undo linux24 bits of writable pagetables
author cl349@freefall.cl.cam.ac.uk
date Mon Jul 19 10:54:16 2004 +0000 (2004-07-19)
parents 101465779482
children 88dcad78fd75
files linux-2.4.26-xen-sparse/include/asm-xen/page.h linux-2.4.26-xen-sparse/include/asm-xen/pgalloc.h linux-2.4.26-xen-sparse/mm/memory.c
line diff
     1.1 --- a/linux-2.4.26-xen-sparse/include/asm-xen/page.h	Mon Jul 19 10:28:37 2004 +0000
     1.2 +++ b/linux-2.4.26-xen-sparse/include/asm-xen/page.h	Mon Jul 19 10:54:16 2004 +0000
     1.3 @@ -78,8 +78,7 @@ typedef struct { unsigned long pgprot; }
     1.4  static inline unsigned long pmd_val(pmd_t x)
     1.5  {
     1.6      unsigned long ret = x.pmd;
     1.7 -    if (!(ret & 0x801) && ret) printk("pmd_val really invalid!!!\n");
     1.8 -    if (ret) ret = machine_to_phys(ret);
     1.9 +    if ( (ret & 1) ) ret = machine_to_phys(ret);
    1.10      return ret;
    1.11  }
    1.12  #define pgd_val(x)	({ BUG(); (unsigned long)0; })
     2.1 --- a/linux-2.4.26-xen-sparse/include/asm-xen/pgalloc.h	Mon Jul 19 10:28:37 2004 +0000
     2.2 +++ b/linux-2.4.26-xen-sparse/include/asm-xen/pgalloc.h	Mon Jul 19 10:54:16 2004 +0000
     2.3 @@ -135,7 +135,7 @@ static inline pte_t *pte_alloc_one(struc
     2.4      {
     2.5          clear_page(pte);
     2.6          __make_page_readonly(pte);
     2.7 -        // queue_pte_pin(__pa(pte));
     2.8 +        queue_pte_pin(__pa(pte));
     2.9      }
    2.10      return pte;
    2.11  
    2.12 @@ -154,7 +154,7 @@ static inline pte_t *pte_alloc_one_fast(
    2.13  
    2.14  static __inline__ void pte_free_slow(pte_t *pte)
    2.15  {
    2.16 -    // queue_pte_unpin(__pa(pte));
    2.17 +    queue_pte_unpin(__pa(pte));
    2.18      __make_page_writeable(pte);
    2.19      free_page((unsigned long)pte);
    2.20  }
     3.1 --- a/linux-2.4.26-xen-sparse/mm/memory.c	Mon Jul 19 10:28:37 2004 +0000
     3.2 +++ b/linux-2.4.26-xen-sparse/mm/memory.c	Mon Jul 19 10:54:16 2004 +0000
     3.3 @@ -163,18 +163,6 @@ void clear_page_tables(struct mm_struct 
     3.4  #define PTE_TABLE_MASK	((PTRS_PER_PTE-1) * sizeof(pte_t))
     3.5  #define PMD_TABLE_MASK	((PTRS_PER_PMD-1) * sizeof(pmd_t))
     3.6  
     3.7 -#undef set_pte
     3.8 -#define set_pte(pteptr, pteval) do { \
     3.9 -	(*(pteptr) = pteval); \
    3.10 -	/* printk("set_pte %p -> %08lx\n", pteptr, pteval); */ \
    3.11 -} while (0)
    3.12 -//void queue_l1_entry_update_queued(pte_t *ptr, unsigned long val);
    3.13 -//#define set_pte(pteptr, pteval) queue_l1_entry_update_queued(pteptr, (pteval).pte_low)
    3.14 -// #define ptep_get_and_clear(xp)	__pte(xchg(&(xp)->pte_low, 0))
    3.15 -//#undef pte_unmap
    3.16 -//#define pte_unmap(pte) xen_flush_page_update_queue()
    3.17 -#undef pmd_bad
    3.18 -#define	pmd_bad(x)	(((x).pmd & (~PAGE_MASK & ~_PAGE_USER & ~_PAGE_PRESENT & ~0x800)) != (_KERNPG_TABLE & ~_PAGE_PRESENT))
    3.19  /*
    3.20   * copy one vm_area from one task to the other. Assumes the page tables
    3.21   * already present in the new task to be cleared in the whole range
    3.22 @@ -196,8 +184,6 @@ int copy_page_range(struct mm_struct *ds
    3.23  
    3.24  	src_pgd = pgd_offset(src, address)-1;
    3.25  	dst_pgd = pgd_offset(dst, address)-1;
    3.26 -        /* printk("copy_page_range src %p dst %p src_pgd %p dst_pgd %p %08lx-%08lx\n", */
    3.27 -/*                src, dst, src_pgd, dst_pgd, address, end); */
    3.28  
    3.29  	for (;;) {
    3.30  		pmd_t * src_pmd, * dst_pmd;
    3.31 @@ -219,7 +205,6 @@ skip_copy_pmd_range:	address = (address 
    3.32  
    3.33  		src_pmd = pmd_offset(src_pgd, address);
    3.34  		dst_pmd = pmd_alloc(dst, dst_pgd, address);
    3.35 -                /* printk("src_pmd %p dst_pmd %p\n", src_pmd, dst_pmd); */
    3.36  		if (!dst_pmd)
    3.37  			goto nomem;
    3.38  
    3.39 @@ -241,8 +226,6 @@ skip_copy_pte_range:		address = (address
    3.40  
    3.41  			src_pte = pte_offset(src_pmd, address);
    3.42  			dst_pte = pte_alloc(dst, dst_pmd, address);
    3.43 -                        /* printk("src_pte %p(%p,%08lx,%08lx, %08lx) dst_pte %p\n", */
    3.44 -/*                                src_pte, src_pmd, *src_pmd, pmd_page(*src_pmd), address, dst_pte); */
    3.45  			if (!dst_pte)
    3.46  				goto nomem;
    3.47  
    3.48 @@ -256,8 +239,6 @@ skip_copy_pte_range:		address = (address
    3.49  				if (pte_none(pte))
    3.50  					goto cont_copy_pte_range_noset;
    3.51  				if (!pte_present(pte)) {
    3.52 -                                    printk("swap_dup call %p:%08lx\n",
    3.53 -                                           src_pte, pte.pte_low);
    3.54  					swap_duplicate(pte_to_swp_entry(pte));
    3.55  					goto cont_copy_pte_range;
    3.56  				}
    3.57 @@ -268,17 +249,10 @@ skip_copy_pte_range:		address = (address
    3.58  
    3.59  				/* If it's a COW mapping, write protect it both in the parent and the child */
    3.60  				if (cow && pte_write(pte)) {
    3.61 -                                    /* printk("ptep_set_wrprotect %p was %08lx\n", src_pte, *src_pte); */
    3.62 -#if 0
    3.63  					/* XEN modification: modified ordering here to avoid RaW hazard. */
    3.64  					pte = *src_pte;
    3.65  					pte = pte_wrprotect(pte);
    3.66  					ptep_set_wrprotect(src_pte);
    3.67 -#else
    3.68 -                                        clear_bit(_PAGE_BIT_RW, src_pte); //ptep_set_wrprotect(src_pte);
    3.69 -					pte = *src_pte;
    3.70 -                                    /* printk("ptep_set_wrprotect %p now %08lx\n", src_pte, *src_pte); */
    3.71 -#endif
    3.72  				}
    3.73  
    3.74  				/* If it's a shared mapping, mark it clean in the child */
    3.75 @@ -304,13 +278,10 @@ cont_copy_pmd_range:	src_pmd++;
    3.76  out_unlock:
    3.77  	spin_unlock(&src->page_table_lock);
    3.78  out:
    3.79 -        /* printk("out\n"); */
    3.80  	return 0;
    3.81  nomem:
    3.82  	return -ENOMEM;
    3.83  }
    3.84 -#undef set_pte
    3.85 -#define set_pte(pteptr, pteval) queue_l1_entry_update(pteptr, (pteval).pte_low)
    3.86  
    3.87  /*
    3.88   * Return indicates whether a page was freed so caller can adjust rss