ia64/xen-unstable

changeset 3627:30412c1eb41d

bitkeeper revision 1.1159.223.61 (4201e2eb-AZrvBiRdKncIUx8FuLkeA)

Fix ioremap() for local RAM pages.
author kaf24@scramble.cl.cam.ac.uk
date Thu Feb 03 08:38:03 2005 +0000 (2005-02-03)
parents 6d07967a51b3
children e922aa58971a 5f3b5a2eb615
files linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable.h
line diff
     1.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c	Wed Feb 02 23:06:19 2005 +0000
     1.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c	Thu Feb 03 08:38:03 2005 +0000
     1.3 @@ -79,6 +79,7 @@ void __iomem * __ioremap(unsigned long p
     1.4  	void __iomem * addr;
     1.5  	struct vm_struct * area;
     1.6  	unsigned long offset, last_addr;
     1.7 +	domid_t domid = DOMID_IO;
     1.8  
     1.9  	/* Don't allow wraparound or zero size */
    1.10  	last_addr = phys_addr + size - 1;
    1.11 @@ -106,6 +107,8 @@ void __iomem * __ioremap(unsigned long p
    1.12  		for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++)
    1.13  			if(!PageReserved(page))
    1.14  				return NULL;
    1.15 +
    1.16 +		domid = DOMID_LOCAL;
    1.17  	}
    1.18  
    1.19  	/*
    1.20 @@ -382,10 +385,13 @@ int direct_remap_area_pages(struct mm_st
    1.21  #define MAX_DIRECTMAP_MMU_QUEUE 130
    1.22  	mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *w, *v;
    1.23  
    1.24 -	u[0].ptr  = MMU_EXTENDED_COMMAND;
    1.25 -	u[0].val  = MMUEXT_SET_FOREIGNDOM;
    1.26 -	u[0].val |= (unsigned long)domid << 16;
    1.27 -	v = w = &u[1];
    1.28 +	v = w = &u[0];
    1.29 +	if (domid != DOMID_LOCAL) {
    1.30 +		u[0].ptr  = MMU_EXTENDED_COMMAND;
    1.31 +		u[0].val  = MMUEXT_SET_FOREIGNDOM;
    1.32 +		u[0].val |= (unsigned long)domid << 16;
    1.33 +		v = w = &u[1];
    1.34 +	}
    1.35  
    1.36  	start_address = address;
    1.37  
     2.1 --- a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Wed Feb 02 23:06:19 2005 +0000
     2.2 +++ b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Thu Feb 03 08:38:03 2005 +0000
     2.3 @@ -475,6 +475,7 @@ void make_pages_writable(void *va, unsig
     2.4  #define kern_addr_valid(addr)	(1)
     2.5  #endif /* !CONFIG_DISCONTIGMEM */
     2.6  
     2.7 +#define DOMID_LOCAL (0xFFFFU)
     2.8  int direct_remap_area_pages(struct mm_struct *mm,
     2.9                              unsigned long address, 
    2.10                              unsigned long machine_addr,
    2.11 @@ -489,17 +490,6 @@ int __direct_remap_area_pages(struct mm_
    2.12  #define io_remap_page_range(vma,from,phys,size,prot) \
    2.13  	direct_remap_area_pages(vma->vm_mm,from,phys,size,prot,DOMID_IO)
    2.14  
    2.15 -int direct_remap_area_pages(struct mm_struct *mm,
    2.16 -			    unsigned long address, 
    2.17 -			    unsigned long machine_addr,
    2.18 -			    unsigned long size, 
    2.19 -			    pgprot_t prot,
    2.20 -			    domid_t  domid);
    2.21 -int __direct_remap_area_pages(struct mm_struct *mm,
    2.22 -			      unsigned long address, 
    2.23 -			      unsigned long size, 
    2.24 -			      mmu_update_t *v);
    2.25 -
    2.26  #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
    2.27  #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
    2.28  #define __HAVE_ARCH_PTEP_GET_AND_CLEAR