ia64/xen-unstable

changeset 9242:57f21f67b532

No need to pin/unpin intermediate pagetables in x86/64 xenlinux.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Mar 12 19:37:38 2006 +0100 (2006-03-12)
parents 9aefef31e040
children 4d38a73999a9
files linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/pgalloc.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c	Sun Mar 12 19:37:00 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c	Sun Mar 12 19:37:38 2006 +0100
     1.3 @@ -201,56 +201,6 @@ void xen_pgd_unpin(unsigned long ptr)
     1.4  	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
     1.5  }
     1.6  
     1.7 -void xen_pte_pin(unsigned long ptr)
     1.8 -{
     1.9 -	struct mmuext_op op;
    1.10 -	op.cmd = MMUEXT_PIN_L1_TABLE;
    1.11 -	op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
    1.12 -	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
    1.13 -}
    1.14 -
    1.15 -void xen_pte_unpin(unsigned long ptr)
    1.16 -{
    1.17 -	struct mmuext_op op;
    1.18 -	op.cmd = MMUEXT_UNPIN_TABLE;
    1.19 -	op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
    1.20 -	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
    1.21 -}
    1.22 -
    1.23 -#ifdef CONFIG_X86_64
    1.24 -void xen_pud_pin(unsigned long ptr)
    1.25 -{
    1.26 -	struct mmuext_op op;
    1.27 -	op.cmd = MMUEXT_PIN_L3_TABLE;
    1.28 -	op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
    1.29 -	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
    1.30 -}
    1.31 -
    1.32 -void xen_pud_unpin(unsigned long ptr)
    1.33 -{
    1.34 -	struct mmuext_op op;
    1.35 -	op.cmd = MMUEXT_UNPIN_TABLE;
    1.36 -	op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
    1.37 -	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
    1.38 -}
    1.39 -
    1.40 -void xen_pmd_pin(unsigned long ptr)
    1.41 -{
    1.42 -	struct mmuext_op op;
    1.43 -	op.cmd = MMUEXT_PIN_L2_TABLE;
    1.44 -	op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
    1.45 -	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
    1.46 -}
    1.47 -
    1.48 -void xen_pmd_unpin(unsigned long ptr)
    1.49 -{
    1.50 -	struct mmuext_op op;
    1.51 -	op.cmd = MMUEXT_UNPIN_TABLE;
    1.52 -	op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
    1.53 -	BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
    1.54 -}
    1.55 -#endif /* CONFIG_X86_64 */
    1.56 -
    1.57  void xen_set_ldt(unsigned long ptr, unsigned long len)
    1.58  {
    1.59  	struct mmuext_op op;
     2.1 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Sun Mar 12 19:37:00 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Sun Mar 12 19:37:38 2006 +0100
     2.3 @@ -244,7 +244,6 @@ static void set_pte_phys(unsigned long v
     2.4  	if (pud_none(*pud)) {
     2.5  		pmd = (pmd_t *) spp_getpage(); 
     2.6  		make_page_readonly(pmd, XENFEAT_writable_page_tables);
     2.7 -		xen_pmd_pin(__pa(pmd));
     2.8  		set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER));
     2.9  		if (pmd != pmd_offset(pud, 0)) {
    2.10  			printk("PAGETABLE BUG #01! %p <-> %p\n", pmd, pmd_offset(pud,0));
    2.11 @@ -255,7 +254,6 @@ static void set_pte_phys(unsigned long v
    2.12  	if (pmd_none(*pmd)) {
    2.13  		pte = (pte_t *) spp_getpage();
    2.14  		make_page_readonly(pte, XENFEAT_writable_page_tables);
    2.15 -		xen_pte_pin(__pa(pte));
    2.16  		set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER));
    2.17  		if (pte != pte_offset_kernel(pmd, 0)) {
    2.18  			printk("PAGETABLE BUG #02!\n");
    2.19 @@ -297,7 +295,6 @@ static void set_pte_phys_ma(unsigned lon
    2.20  
    2.21  		pmd = (pmd_t *) spp_getpage(); 
    2.22  		make_page_readonly(pmd, XENFEAT_writable_page_tables);
    2.23 -		xen_pmd_pin(__pa(pmd));
    2.24  
    2.25  		set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER));
    2.26  
    2.27 @@ -311,7 +308,6 @@ static void set_pte_phys_ma(unsigned lon
    2.28  	if (pmd_none(*pmd)) {
    2.29  		pte = (pte_t *) spp_getpage();
    2.30  		make_page_readonly(pte, XENFEAT_writable_page_tables);
    2.31 -		xen_pte_pin(__pa(pte));
    2.32  
    2.33  		set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER));
    2.34  		if (pte != pte_offset_kernel(pmd, 0)) {
    2.35 @@ -461,7 +457,6 @@ phys_pmd_init(pmd_t *pmd, unsigned long 
    2.36  		}
    2.37  		pte = pte_save;
    2.38  		early_make_page_readonly(pte, XENFEAT_writable_page_tables);
    2.39 -		xen_pte_pin(pte_phys);
    2.40  		set_pmd(pmd, __pmd(pte_phys | _KERNPG_TABLE));
    2.41  	}
    2.42  }
    2.43 @@ -500,7 +495,6 @@ static void __meminit phys_pud_init(pud_
    2.44  
    2.45  		pmd = alloc_static_page(&pmd_phys);
    2.46  		early_make_page_readonly(pmd, XENFEAT_writable_page_tables);
    2.47 -		xen_pmd_pin(pmd_phys);
    2.48  		spin_lock(&init_mm.page_table_lock);
    2.49  		set_pud(pud, __pud(pmd_phys | _KERNPG_TABLE));
    2.50  		phys_pmd_init(pmd, paddr, end);
    2.51 @@ -545,9 +539,6 @@ void __init xen_init_pt(void)
    2.52  
    2.53  	xen_pgd_pin(__pa_symbol(init_level4_pgt));
    2.54  	xen_pgd_pin(__pa_symbol(init_level4_user_pgt));
    2.55 -	xen_pud_pin(__pa_symbol(level3_kernel_pgt));
    2.56 -	xen_pud_pin(__pa_symbol(level3_user_pgt));
    2.57 -	xen_pmd_pin(__pa_symbol(level2_kernel_pgt));
    2.58  
    2.59  	set_pgd((pgd_t *)(init_level4_user_pgt + 511), 
    2.60  		mk_kernel_pgd(__pa_symbol(level3_user_pgt)));
    2.61 @@ -581,7 +572,6 @@ void __init extend_init_mapping(void)
    2.62  			pte_page = alloc_static_page(&phys);
    2.63  			early_make_page_readonly(
    2.64  				pte_page, XENFEAT_writable_page_tables);
    2.65 -			xen_pte_pin(phys);
    2.66  			set_pmd(pmd, __pmd(phys | _KERNPG_TABLE | _PAGE_USER));
    2.67  		} else {
    2.68  			addr = page[pmd_index(va)];
    2.69 @@ -662,7 +652,6 @@ void __meminit init_memory_mapping(unsig
    2.70  			pud = alloc_static_page(&pud_phys);
    2.71  			early_make_page_readonly(pud, XENFEAT_writable_page_tables);
    2.72  		}
    2.73 -		xen_pud_pin(pud_phys);
    2.74  		next = start + PGDIR_SIZE;
    2.75  		if (next > end) 
    2.76  			next = end; 
    2.77 @@ -943,7 +932,6 @@ void free_initmem(void)
    2.78  		ClearPageReserved(virt_to_page(addr));
    2.79  		set_page_count(virt_to_page(addr), 1);
    2.80  		memset((void *)(addr & ~(PAGE_SIZE-1)), 0xcc, PAGE_SIZE); 
    2.81 -		xen_pte_unpin(__pa(addr));
    2.82  		make_page_writable(
    2.83  			__va(__pa(addr)), XENFEAT_writable_page_tables);
    2.84  		/*
     3.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h	Sun Mar 12 19:37:00 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h	Sun Mar 12 19:37:38 2006 +0100
     3.3 @@ -79,12 +79,6 @@ void xen_l3_entry_update(pud_t *ptr, pud
     3.4  void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */
     3.5  void xen_pgd_pin(unsigned long ptr);
     3.6  void xen_pgd_unpin(unsigned long ptr);
     3.7 -void xen_pud_pin(unsigned long ptr); /* x86_64 only */
     3.8 -void xen_pud_unpin(unsigned long ptr); /* x86_64 only */
     3.9 -void xen_pmd_pin(unsigned long ptr); /* x86_64 only */
    3.10 -void xen_pmd_unpin(unsigned long ptr); /* x86_64 only */
    3.11 -void xen_pte_pin(unsigned long ptr);
    3.12 -void xen_pte_unpin(unsigned long ptr);
    3.13  
    3.14  void xen_set_ldt(unsigned long ptr, unsigned long bytes);
    3.15  void xen_machphys_update(unsigned long mfn, unsigned long pfn);
     4.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/pgalloc.h	Sun Mar 12 19:37:00 2006 +0100
     4.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/pgalloc.h	Sun Mar 12 19:37:38 2006 +0100
     4.3 @@ -181,7 +181,6 @@ static inline struct page *pte_alloc_one
     4.4  static inline void pte_free_kernel(pte_t *pte)
     4.5  {
     4.6  	BUG_ON((unsigned long)pte & (PAGE_SIZE-1));
     4.7 -        xen_pte_unpin(__pa(pte));
     4.8          make_page_writable(pte, XENFEAT_writable_page_tables);
     4.9  	free_page((unsigned long)pte); 
    4.10  }