ia64/xen-unstable

changeset 4142:dff04529e881

bitkeeper revision 1.1236.32.3 (42360bc220YuUEOiskz-8He4ZH_lCw)

Temporary hack for linux 2.6.10 to use shadow mode instead of
writable page tables.

Signed-off-by: michael.fetterman@cl.cam.ac.uk
author mafetter@fleming.research
date Mon Mar 14 22:10:10 2005 +0000 (2005-03-14)
parents 67c3463e70f1
children 4ff298f651de
files linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c linux-2.6.10-xen-sparse/arch/xen/i386/mm/pgtable.c
line diff
     1.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c	Mon Mar 14 22:07:47 2005 +0000
     1.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c	Mon Mar 14 22:10:10 2005 +0000
     1.3 @@ -125,28 +125,14 @@ static inline void increment_index_and_f
     1.4  
     1.5  void queue_l1_entry_update(pte_t *ptr, unsigned long val)
     1.6  {
     1.7 -    int cpu = smp_processor_id();
     1.8 -    int idx;
     1.9 -    unsigned long flags;
    1.10 -    spin_lock_irqsave(&update_lock, flags);
    1.11 -    idx = per_cpu(mmu_update_queue_idx, cpu);
    1.12 -    per_cpu(update_queue[idx], cpu).ptr = virt_to_machine(ptr);
    1.13 -    per_cpu(update_queue[idx], cpu).val = val;
    1.14 -    increment_index();
    1.15 -    spin_unlock_irqrestore(&update_lock, flags);
    1.16 +    _flush_page_update_queue();
    1.17 +    *(unsigned long *)ptr = val;
    1.18  }
    1.19  
    1.20  void queue_l2_entry_update(pmd_t *ptr, unsigned long val)
    1.21  {
    1.22 -    int cpu = smp_processor_id();
    1.23 -    int idx;
    1.24 -    unsigned long flags;
    1.25 -    spin_lock_irqsave(&update_lock, flags);
    1.26 -    idx = per_cpu(mmu_update_queue_idx, cpu);
    1.27 -    per_cpu(update_queue[idx], cpu).ptr = virt_to_machine(ptr);
    1.28 -    per_cpu(update_queue[idx], cpu).val = val;
    1.29 -    increment_index();
    1.30 -    spin_unlock_irqrestore(&update_lock, flags);
    1.31 +    _flush_page_update_queue();
    1.32 +    *(unsigned long *)ptr = val;
    1.33  }
    1.34  
    1.35  void queue_pt_switch(unsigned long ptr)
    1.36 @@ -275,28 +261,12 @@ void queue_machphys_update(unsigned long
    1.37  /* queue and flush versions of the above */
    1.38  void xen_l1_entry_update(pte_t *ptr, unsigned long val)
    1.39  {
    1.40 -    int cpu = smp_processor_id();
    1.41 -    int idx;
    1.42 -    unsigned long flags;
    1.43 -    spin_lock_irqsave(&update_lock, flags);
    1.44 -    idx = per_cpu(mmu_update_queue_idx, cpu);
    1.45 -    per_cpu(update_queue[idx], cpu).ptr = virt_to_machine(ptr);
    1.46 -    per_cpu(update_queue[idx], cpu).val = val;
    1.47 -    increment_index_and_flush();
    1.48 -    spin_unlock_irqrestore(&update_lock, flags);
    1.49 +    *(unsigned long *)ptr = val;
    1.50  }
    1.51  
    1.52  void xen_l2_entry_update(pmd_t *ptr, unsigned long val)
    1.53  {
    1.54 -    int cpu = smp_processor_id();
    1.55 -    int idx;
    1.56 -    unsigned long flags;
    1.57 -    spin_lock_irqsave(&update_lock, flags);
    1.58 -    idx = per_cpu(mmu_update_queue_idx, cpu);
    1.59 -    per_cpu(update_queue[idx], cpu).ptr = virt_to_machine(ptr);
    1.60 -    per_cpu(update_queue[idx], cpu).val = val;
    1.61 -    increment_index_and_flush();
    1.62 -    spin_unlock_irqrestore(&update_lock, flags);
    1.63 +    *(unsigned long *)ptr = val;
    1.64  }
    1.65  
    1.66  void xen_pt_switch(unsigned long ptr)
     2.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c	Mon Mar 14 22:07:47 2005 +0000
     2.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c	Mon Mar 14 22:10:10 2005 +0000
     2.3 @@ -77,7 +77,7 @@ static pte_t * __init one_page_table_ini
     2.4  {
     2.5  	if (pmd_none(*pmd)) {
     2.6  		pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
     2.7 -		make_page_readonly(page_table);
     2.8 +		//make_page_readonly(page_table);
     2.9  		set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
    2.10  		if (page_table != pte_offset_kernel(pmd, 0))
    2.11  			BUG();	
    2.12 @@ -349,7 +349,7 @@ static void __init pagetable_init (void)
    2.13  	 * it. We clean up by write-enabling and then freeing the old page dir.
    2.14  	 */
    2.15  	memcpy(new_pgd, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
    2.16 -	make_page_readonly(new_pgd);
    2.17 +	//make_page_readonly(new_pgd);
    2.18  	queue_pgd_pin(__pa(new_pgd));
    2.19  	load_cr3(new_pgd);
    2.20  	queue_pgd_unpin(__pa(old_pgd));
     3.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/pgtable.c	Mon Mar 14 22:07:47 2005 +0000
     3.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/pgtable.c	Mon Mar 14 22:10:10 2005 +0000
     3.3 @@ -181,7 +181,7 @@ pte_t *pte_alloc_one_kernel(struct mm_st
     3.4  	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
     3.5  	if (pte) {
     3.6  		clear_page(pte);
     3.7 -		make_page_readonly(pte);
     3.8 +		//make_page_readonly(pte);
     3.9  		xen_flush_page_update_queue();
    3.10  	}
    3.11  	return pte;
    3.12 @@ -194,7 +194,7 @@ void pte_ctor(void *pte, kmem_cache_t *c
    3.13  	set_page_count(page, 1);
    3.14  
    3.15  	clear_page(pte);
    3.16 -	make_page_readonly(pte);
    3.17 +	//make_page_readonly(pte);
    3.18  	queue_pte_pin(__pa(pte));
    3.19  	flush_page_update_queue();
    3.20  }
    3.21 @@ -304,7 +304,7 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
    3.22  	spin_unlock_irqrestore(&pgd_lock, flags);
    3.23  	memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
    3.24   out:
    3.25 -	make_page_readonly(pgd);
    3.26 +	//make_page_readonly(pgd);
    3.27  	queue_pgd_pin(__pa(pgd));
    3.28  	flush_page_update_queue();
    3.29  }