aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>2004-07-19 10:54:16 +0000
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>2004-07-19 10:54:16 +0000
commit0ac24a13aac1c2d772988205d032a2e3c5448bbb (patch)
tree38d05d07a676b9cfe1a5287c1f456659e66e9780
parentaa806c54e500df011ee9e2b343a9c734bae2c46f (diff)
downloadxen-0ac24a13aac1c2d772988205d032a2e3c5448bbb.tar.gz
xen-0ac24a13aac1c2d772988205d032a2e3c5448bbb.tar.bz2
xen-0ac24a13aac1c2d772988205d032a2e3c5448bbb.zip
bitkeeper revision 1.1110 (40fba858q1HuMzljocVdGkLuG4dxfw)
undo linux24 bits of writable pagetables
-rw-r--r--linux-2.4.26-xen-sparse/include/asm-xen/page.h3
-rw-r--r--linux-2.4.26-xen-sparse/include/asm-xen/pgalloc.h4
-rw-r--r--linux-2.4.26-xen-sparse/mm/memory.c29
3 files changed, 3 insertions, 33 deletions
diff --git a/linux-2.4.26-xen-sparse/include/asm-xen/page.h b/linux-2.4.26-xen-sparse/include/asm-xen/page.h
index 582992f1a2..6826f65cc0 100644
--- a/linux-2.4.26-xen-sparse/include/asm-xen/page.h
+++ b/linux-2.4.26-xen-sparse/include/asm-xen/page.h
@@ -78,8 +78,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
static inline unsigned long pmd_val(pmd_t x)
{
unsigned long ret = x.pmd;
- if (!(ret & 0x801) && ret) printk("pmd_val really invalid!!!\n");
- if (ret) ret = machine_to_phys(ret);
+ if ( (ret & 1) ) ret = machine_to_phys(ret);
return ret;
}
#define pgd_val(x) ({ BUG(); (unsigned long)0; })
diff --git a/linux-2.4.26-xen-sparse/include/asm-xen/pgalloc.h b/linux-2.4.26-xen-sparse/include/asm-xen/pgalloc.h
index c6ce165432..143beeeef5 100644
--- a/linux-2.4.26-xen-sparse/include/asm-xen/pgalloc.h
+++ b/linux-2.4.26-xen-sparse/include/asm-xen/pgalloc.h
@@ -135,7 +135,7 @@ static inline pte_t *pte_alloc_one(struct mm_struct *mm, unsigned long address)
{
clear_page(pte);
__make_page_readonly(pte);
- // queue_pte_pin(__pa(pte));
+ queue_pte_pin(__pa(pte));
}
return pte;
@@ -154,7 +154,7 @@ static inline pte_t *pte_alloc_one_fast(struct mm_struct *mm,
static __inline__ void pte_free_slow(pte_t *pte)
{
- // queue_pte_unpin(__pa(pte));
+ queue_pte_unpin(__pa(pte));
__make_page_writeable(pte);
free_page((unsigned long)pte);
}
diff --git a/linux-2.4.26-xen-sparse/mm/memory.c b/linux-2.4.26-xen-sparse/mm/memory.c
index a60d07042f..6bdb08afe7 100644
--- a/linux-2.4.26-xen-sparse/mm/memory.c
+++ b/linux-2.4.26-xen-sparse/mm/memory.c
@@ -163,18 +163,6 @@ void clear_page_tables(struct mm_struct *mm, unsigned long first, int nr)
#define PTE_TABLE_MASK ((PTRS_PER_PTE-1) * sizeof(pte_t))
#define PMD_TABLE_MASK ((PTRS_PER_PMD-1) * sizeof(pmd_t))
-#undef set_pte
-#define set_pte(pteptr, pteval) do { \
- (*(pteptr) = pteval); \
- /* printk("set_pte %p -> %08lx\n", pteptr, pteval); */ \
-} while (0)
-//void queue_l1_entry_update_queued(pte_t *ptr, unsigned long val);
-//#define set_pte(pteptr, pteval) queue_l1_entry_update_queued(pteptr, (pteval).pte_low)
-// #define ptep_get_and_clear(xp) __pte(xchg(&(xp)->pte_low, 0))
-//#undef pte_unmap
-//#define pte_unmap(pte) xen_flush_page_update_queue()
-#undef pmd_bad
-#define pmd_bad(x) (((x).pmd & (~PAGE_MASK & ~_PAGE_USER & ~_PAGE_PRESENT & ~0x800)) != (_KERNPG_TABLE & ~_PAGE_PRESENT))
/*
* copy one vm_area from one task to the other. Assumes the page tables
* already present in the new task to be cleared in the whole range
@@ -196,8 +184,6 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
src_pgd = pgd_offset(src, address)-1;
dst_pgd = pgd_offset(dst, address)-1;
- /* printk("copy_page_range src %p dst %p src_pgd %p dst_pgd %p %08lx-%08lx\n", */
-/* src, dst, src_pgd, dst_pgd, address, end); */
for (;;) {
pmd_t * src_pmd, * dst_pmd;
@@ -219,7 +205,6 @@ skip_copy_pmd_range: address = (address + PGDIR_SIZE) & PGDIR_MASK;
src_pmd = pmd_offset(src_pgd, address);
dst_pmd = pmd_alloc(dst, dst_pgd, address);
- /* printk("src_pmd %p dst_pmd %p\n", src_pmd, dst_pmd); */
if (!dst_pmd)
goto nomem;
@@ -241,8 +226,6 @@ skip_copy_pte_range: address = (address + PMD_SIZE) & PMD_MASK;
src_pte = pte_offset(src_pmd, address);
dst_pte = pte_alloc(dst, dst_pmd, address);
- /* printk("src_pte %p(%p,%08lx,%08lx, %08lx) dst_pte %p\n", */
-/* src_pte, src_pmd, *src_pmd, pmd_page(*src_pmd), address, dst_pte); */
if (!dst_pte)
goto nomem;
@@ -256,8 +239,6 @@ skip_copy_pte_range: address = (address + PMD_SIZE) & PMD_MASK;
if (pte_none(pte))
goto cont_copy_pte_range_noset;
if (!pte_present(pte)) {
- printk("swap_dup call %p:%08lx\n",
- src_pte, pte.pte_low);
swap_duplicate(pte_to_swp_entry(pte));
goto cont_copy_pte_range;
}
@@ -268,17 +249,10 @@ skip_copy_pte_range: address = (address + PMD_SIZE) & PMD_MASK;
/* If it's a COW mapping, write protect it both in the parent and the child */
if (cow && pte_write(pte)) {
- /* printk("ptep_set_wrprotect %p was %08lx\n", src_pte, *src_pte); */
-#if 0
/* XEN modification: modified ordering here to avoid RaW hazard. */
pte = *src_pte;
pte = pte_wrprotect(pte);
ptep_set_wrprotect(src_pte);
-#else
- clear_bit(_PAGE_BIT_RW, src_pte); //ptep_set_wrprotect(src_pte);
- pte = *src_pte;
- /* printk("ptep_set_wrprotect %p now %08lx\n", src_pte, *src_pte); */
-#endif
}
/* If it's a shared mapping, mark it clean in the child */
@@ -304,13 +278,10 @@ cont_copy_pmd_range: src_pmd++;
out_unlock:
spin_unlock(&src->page_table_lock);
out:
- /* printk("out\n"); */
return 0;
nomem:
return -ENOMEM;
}
-#undef set_pte
-#define set_pte(pteptr, pteval) queue_l1_entry_update(pteptr, (pteval).pte_low)
/*
* Return indicates whether a page was freed so caller can adjust rss