# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Node ID 0482a91e0c7823af93e8d0036a828bcc3bf04f42 # Parent 2d390dde40af892fcc1a334a2967ccf847810e50 introduce xen_arch_privcmd_mmap() to allow xen/ia64 to override privcmd_mmap() later. xen/ia64 with dom0 vp model also needs direct_remap_pfn_range() to be called for IOCTL_PRIVCMD_MMAPBATCH. These changes are necessary for xen/ia64 with dom0 vp model. PATCHNAME: xen_arch_privcmd_mmap Signed-off-by: Isaku Yamahata diff -r 2d390dde40af -r 0482a91e0c78 linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c Fri Apr 28 11:09:00 2006 +0900 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c Fri Apr 28 11:10:17 2006 +0900 @@ -159,12 +159,14 @@ static int privcmd_ioctl(struct inode *i break; case IOCTL_PRIVCMD_MMAPBATCH: { +#ifndef __ia64__ mmu_update_t u; + uint64_t ptep; +#endif privcmd_mmapbatch_t m; struct vm_area_struct *vma = NULL; unsigned long __user *p; unsigned long addr, mfn; - uint64_t ptep; int i; if (copy_from_user(&m, udata, sizeof(m))) { @@ -199,11 +201,9 @@ static int privcmd_ioctl(struct inode *i if (get_user(mfn, p)) return -EFAULT; #ifdef __ia64__ - ret = remap_pfn_range(vma, - addr&PAGE_MASK, - mfn, - 1<vm_page_prot); + ret = direct_remap_pfn_range(vma, addr & PAGE_MASK, + mfn, 1 << PAGE_SHIFT, + vma->vm_page_prot, m.dom); if (ret < 0) goto batch_err; #else @@ -246,7 +246,7 @@ static int privcmd_mmap(struct file * fi /* DONTCOPY is essential for Xen as copy_page_range is broken. */ vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY; - return 0; + return xen_arch_privcmd_mmap(file, vma); } static struct file_operations privcmd_file_ops = { diff -r 2d390dde40af -r 0482a91e0c78 linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h Fri Apr 28 11:09:00 2006 +0900 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h Fri Apr 28 11:10:17 2006 +0900 @@ -117,6 +117,7 @@ u64 jiffies_to_st(unsigned long jiffies) #endif #define xen_init() (0) +#define xen_arch_privcmd_mmap(file, vma) (0) static inline int HYPERVISOR_yield( diff -r 2d390dde40af -r 0482a91e0c78 linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h --- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h Fri Apr 28 11:09:00 2006 +0900 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h Fri Apr 28 11:10:17 2006 +0900 @@ -117,6 +117,7 @@ HYPERVISOR_poll( // for drivers/xen/privcmd/privcmd.c #define direct_remap_pfn_range(a,b,c,d,e,f) remap_pfn_range(a,b,c,d,e) #define machine_to_phys_mapping 0 +#define xen_arch_privcmd_mmap(file, vma) 0 #ifndef CONFIG_XEN_IA64_DOM0_VP #define pfn_to_mfn(x) (x) #define mfn_to_pfn(x) (x)