direct-io.hg

changeset 10564:129ce4f59b6d

[LINUX] Replace pagetable walks by simple address calculation.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@dhcp93.uk.xensource.com
date Fri Jun 30 10:35:54 2006 +0100 (2006-06-30)
parents a75c1bdfe761
children 53f552ad4042
files linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c	Fri Jun 30 10:24:14 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c	Fri Jun 30 10:35:54 2006 +0100
     1.3 @@ -271,10 +271,6 @@ static unsigned long discontig_frames[1<
     1.4  int xen_create_contiguous_region(
     1.5  	unsigned long vstart, unsigned int order, unsigned int address_bits)
     1.6  {
     1.7 -	pgd_t         *pgd; 
     1.8 -	pud_t         *pud; 
     1.9 -	pmd_t         *pmd;
    1.10 -	pte_t         *pte;
    1.11  	unsigned long *in_frames = discontig_frames, out_frame;
    1.12  	unsigned long  frame, i, flags;
    1.13  	long           rc;
    1.14 @@ -313,11 +309,7 @@ int xen_create_contiguous_region(
    1.15  
    1.16  	/* 1. Zap current PTEs, remembering MFNs. */
    1.17  	for (i = 0; i < (1UL<<order); i++) {
    1.18 -		pgd = pgd_offset_k(vstart + (i*PAGE_SIZE));
    1.19 -		pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
    1.20 -		pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
    1.21 -		pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
    1.22 -		in_frames[i] = pte_mfn(*pte);
    1.23 +		in_frames[i] = pfn_to_mfn((__pa(vstart) >> PAGE_SHIFT) + i);
    1.24  		if (HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE),
    1.25  						 __pte_ma(0), 0))
    1.26  			BUG();
    1.27 @@ -372,10 +364,6 @@ int xen_create_contiguous_region(
    1.28  
    1.29  void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order)
    1.30  {
    1.31 -	pgd_t         *pgd; 
    1.32 -	pud_t         *pud; 
    1.33 -	pmd_t         *pmd;
    1.34 -	pte_t         *pte;
    1.35  	unsigned long *out_frames = discontig_frames, in_frame;
    1.36  	unsigned long  frame, i, flags;
    1.37  	long           rc;
    1.38 @@ -410,11 +398,7 @@ void xen_destroy_contiguous_region(unsig
    1.39  	contiguous_bitmap_clear(__pa(vstart) >> PAGE_SHIFT, 1UL << order);
    1.40  
    1.41  	/* 1. Find start MFN of contiguous extent. */
    1.42 -	pgd = pgd_offset_k(vstart);
    1.43 -	pud = pud_offset(pgd, vstart);
    1.44 -	pmd = pmd_offset(pud, vstart);
    1.45 -	pte = pte_offset_kernel(pmd, vstart);
    1.46 -	in_frame = pte_mfn(*pte);
    1.47 +	in_frame = pfn_to_mfn(__pa(vstart) >> PAGE_SHIFT);
    1.48  
    1.49  	/* 2. Zap current PTEs. */
    1.50  	for (i = 0; i < (1UL<<order); i++) {