ia64/linux-2.6.18-xen.hg

changeset 885:a4b49dff3387

blktap2: add tlb flush properly.

xen_invlpg() flushes tlb on its cpu, but tlb flush is needed on
all cpus. So replace xen_invlpg() with more proper ones.
Maybe it would be possible to make tlb flush less.
this patch also makes blktap2 compile on ia64 because xen_invlpg()
is x86 specific.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Thu May 28 10:04:26 2009 +0100 (2009-05-28)
parents c7c92f868aa1
children 3e01555dd227
files drivers/xen/blktap2/device.c
line diff
     1.1 --- a/drivers/xen/blktap2/device.c	Thu May 28 10:00:03 2009 +0100
     1.2 +++ b/drivers/xen/blktap2/device.c	Thu May 28 10:04:26 2009 +0100
     1.3 @@ -3,6 +3,7 @@
     1.4  #include <linux/cdrom.h>
     1.5  #include <linux/hdreg.h>
     1.6  #include <linux/module.h>
     1.7 +#include <asm/tlbflush.h>
     1.8  
     1.9  #include <scsi/scsi.h>
    1.10  #include <scsi/scsi_ioctl.h>
    1.11 @@ -163,7 +164,6 @@ blktap_map_uaddr_fn(pte_t *ptep, struct 
    1.12  
    1.13  	BTDBG("ptep %p -> %012llx\n", ptep, pte_val(*pte));
    1.14  	set_pte(ptep, *pte);
    1.15 -	xen_invlpg(addr);
    1.16  	return 0;
    1.17  }
    1.18  
    1.19 @@ -182,7 +182,6 @@ blktap_umap_uaddr_fn(pte_t *ptep, struct
    1.20  
    1.21  	BTDBG("ptep %p\n", ptep);
    1.22  	pte_clear(mm, addr, ptep);
    1.23 -	xen_invlpg(addr);
    1.24  	return 0;
    1.25  }
    1.26  
    1.27 @@ -322,6 +321,7 @@ blktap_unmap(struct blktap *tap, struct 
    1.28  		if (request->handles[i].kernel == INVALID_GRANT_HANDLE) {
    1.29  			kvaddr = request_to_kaddr(request, i);
    1.30  			blktap_umap_uaddr(&init_mm, kvaddr);
    1.31 +			flush_tlb_kernel_range(kvaddr, kvaddr + PAGE_SIZE);
    1.32  			set_phys_to_machine(__pa(kvaddr) >> PAGE_SHIFT,
    1.33  					    INVALID_P2M_ENTRY);
    1.34  		}
    1.35 @@ -551,7 +551,9 @@ blktap_map(struct blktap *tap,
    1.36  
    1.37  	pte = mk_pte(page, ring->vma->vm_page_prot);
    1.38  	blktap_map_uaddr(ring->vma->vm_mm, uvaddr, pte_mkwrite(pte));
    1.39 +	flush_tlb_mm(ring->vma->vm_mm);
    1.40  	blktap_map_uaddr(&init_mm, kvaddr, mk_pte(page, PAGE_KERNEL));
    1.41 +	flush_tlb_kernel_range(kvaddr, kvaddr + PAGE_SIZE);
    1.42  
    1.43  	set_phys_to_machine(__pa(kvaddr) >> PAGE_SHIFT, pte_mfn(pte));
    1.44  	request->handles[seg].kernel = INVALID_GRANT_HANDLE;