direct-io.hg

changeset 3223:89652683e374

bitkeeper revision 1.1159.183.36 (41acb9afGXKf6dCUiTQJ2FnwLEpJEg)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
into scramble.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
author kaf24@scramble.cl.cam.ac.uk
date Tue Nov 30 18:19:27 2004 +0000 (2004-11-30)
parents 1a3005f838bc e69f042ff97a
children cac49ad6b476
files linux-2.6.9-xen-sparse/arch/xen/i386/kernel/cpu/common.c linux-2.6.9-xen-sparse/arch/xen/i386/mm/init.c linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h
line diff
     1.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Tue Nov 30 17:17:52 2004 +0000
     1.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Tue Nov 30 18:19:27 2004 +0000
     1.3 @@ -513,7 +513,7 @@ void __init cpu_gdt_init(struct Xgt_desc
     1.4  	     va < gdt_descr->address + gdt_descr->size;
     1.5  	     va += PAGE_SIZE, f++) {
     1.6  		frames[f] = virt_to_machine(va) >> PAGE_SHIFT;
     1.7 -		protect_page(swapper_pg_dir, (void *)va, PROT_ON);
     1.8 +		make_page_readonly((void *)va);
     1.9  	}
    1.10  	flush_page_update_queue();
    1.11  	if (HYPERVISOR_set_gdt(frames, gdt_descr->size / 8))
     2.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/mm/init.c	Tue Nov 30 17:17:52 2004 +0000
     2.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/mm/init.c	Tue Nov 30 18:19:27 2004 +0000
     2.3 @@ -77,12 +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 -		/* XEN: Make the new p.t. read-only. */
     2.8 -		pgd_t *kpgd = pgd_offset_k((unsigned long)page_table);
     2.9 -		pmd_t *kpmd = pmd_offset(kpgd, (unsigned long)page_table);
    2.10 -		pte_t *kpte = pte_offset_kernel(kpmd, (unsigned long)page_table);
    2.11 -		xen_l1_entry_update(
    2.12 -			kpte, (*(unsigned long *)kpte)&~_PAGE_RW);
    2.13 +		make_page_readonly(page_table);
    2.14  		set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
    2.15  		if (page_table != pte_offset_kernel(pmd, 0))
    2.16  			BUG();	
    2.17 @@ -131,22 +126,6 @@ static void __init page_table_range_init
    2.18  	}
    2.19  }
    2.20  
    2.21 -void __init protect_page(pgd_t *pgd, void *page, int mode)
    2.22 -{
    2.23 -	pmd_t *pmd;
    2.24 -	pte_t *pte;
    2.25 -	unsigned long addr;
    2.26 -
    2.27 -	addr = (unsigned long)page;
    2.28 -	pgd += pgd_index(addr);
    2.29 -	pmd = pmd_offset(pgd, addr);
    2.30 -	pte = pte_offset_kernel(pmd, addr);
    2.31 -	if (!pte_present(*pte))
    2.32 -		return;
    2.33 -	queue_l1_entry_update(pte, mode ? pte_val_ma(*pte) & ~_PAGE_RW :
    2.34 -					pte_val_ma(*pte) | _PAGE_RW);
    2.35 -}
    2.36 -
    2.37  static inline int is_kernel_text(unsigned long addr)
    2.38  {
    2.39  	if (addr >= (unsigned long)_stext && addr <= (unsigned long)__init_end)
    2.40 @@ -370,12 +349,12 @@ static void __init pagetable_init (void)
    2.41  	 * it. We clean up by write-enabling and then freeing the old page dir.
    2.42  	 */
    2.43  	memcpy(new_pgd, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
    2.44 -	protect_page(new_pgd, new_pgd, PROT_ON);
    2.45 +	make_page_readonly(new_pgd);
    2.46  	queue_pgd_pin(__pa(new_pgd));
    2.47  	load_cr3(new_pgd);
    2.48  	queue_pgd_unpin(__pa(old_pgd));
    2.49  	__flush_tlb_all(); /* implicit flush */
    2.50 -	protect_page(new_pgd, old_pgd, PROT_OFF);
    2.51 +	make_page_writable(old_pgd);
    2.52  	flush_page_update_queue();
    2.53  	free_bootmem(__pa(old_pgd), PAGE_SIZE);
    2.54  
     3.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h	Tue Nov 30 17:17:52 2004 +0000
     3.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h	Tue Nov 30 18:19:27 2004 +0000
     3.3 @@ -54,12 +54,6 @@ void xen_cpu_idle (void);
     3.4  /* arch/xen/i386/kernel/hypervisor.c */
     3.5  void do_hypervisor_callback(struct pt_regs *regs);
     3.6  
     3.7 -/* arch/xen/i386/mm/init.c */
     3.8 -/* NOTE: caller must call flush_page_update_queue() */
     3.9 -#define PROT_ON  1
    3.10 -#define PROT_OFF 0
    3.11 -void /* __init */ protect_page(pgd_t *dpgd, void *page, int mode);
    3.12 -
    3.13  /* arch/xen/i386/kernel/head.S */
    3.14  void lgdt_finish(void);
    3.15