From: BitKeeper B. <ri...@su...> - 2005-02-03 11:23:32
|
ChangeSet 1.1711, 2005/02/03 08:38:03+00:00, ka...@sc... Fix ioremap() for local RAM pages. arch/xen/i386/mm/ioremap.c | 14 ++++++++++---- include/asm-xen/asm-i386/pgtable.h | 12 +----------- 2 files changed, 11 insertions(+), 15 deletions(-) diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c 2005-02-03 05:03:29 -05:00 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c 2005-02-03 05:03:29 -05:00 @@ -79,6 +79,7 @@ void __iomem * addr; struct vm_struct * area; unsigned long offset, last_addr; + domid_t domid = DOMID_IO; /* Don't allow wraparound or zero size */ last_addr = phys_addr + size - 1; @@ -106,6 +107,8 @@ for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++) if(!PageReserved(page)) return NULL; + + domid = DOMID_LOCAL; } /* @@ -382,10 +385,13 @@ #define MAX_DIRECTMAP_MMU_QUEUE 130 mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *w, *v; - u[0].ptr = MMU_EXTENDED_COMMAND; - u[0].val = MMUEXT_SET_FOREIGNDOM; - u[0].val |= (unsigned long)domid << 16; - v = w = &u[1]; + v = w = &u[0]; + if (domid != DOMID_LOCAL) { + u[0].ptr = MMU_EXTENDED_COMMAND; + u[0].val = MMUEXT_SET_FOREIGNDOM; + u[0].val |= (unsigned long)domid << 16; + v = w = &u[1]; + } start_address = address; diff -Nru a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable.h b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable.h --- a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable.h 2005-02-03 05:03:29 -05:00 +++ b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable.h 2005-02-03 05:03:29 -05:00 @@ -475,6 +475,7 @@ #define kern_addr_valid(addr) (1) #endif /* !CONFIG_DISCONTIGMEM */ +#define DOMID_LOCAL (0xFFFFU) int direct_remap_area_pages(struct mm_struct *mm, unsigned long address, unsigned long machine_addr, @@ -488,17 +489,6 @@ #define io_remap_page_range(vma,from,phys,size,prot) \ direct_remap_area_pages(vma->vm_mm,from,phys,size,prot,DOMID_IO) - -int direct_remap_area_pages(struct mm_struct *mm, - unsigned long address, - unsigned long machine_addr, - unsigned long size, - pgprot_t prot, - domid_t domid); -int __direct_remap_area_pages(struct mm_struct *mm, - unsigned long address, - unsigned long size, - mmu_update_t *v); #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY |