introduce xen_arch_privcmd_mmap() to override privcmd_mmap()
This will be defined by xen/ia64 with dom0 vp model.
IOCTL_PRIVCMD_MMAPBATCH clean up.
xen/ia64 with dom0 vp model needs direct_remap_pfn_range() to be called
for IOCTL_PRIVCMD_MMAPBATCH.

-- 
yamahata
# HG changeset patch
# User [EMAIL PROTECTED]
# Node ID 83baf855f331951bcd74ffaf6cd83ca3a2c23131
# Parent  1ad06bd6832d478b18b1c1aed9886079c272aeaa
introduce xen_arch_privcmd_mmap() to override privcmd_mmap()
This will be defined by xen/ia64 with dom0 vp model.
IOCTL_PRIVCMD_MMAPBATCH clean up.
xen/ia64 with dom0 vp model needs direct_remap_pfn_range() to be called
for IOCTL_PRIVCMD_MMAPBATCH.
PATCHNAME: xen_arch_privcmd_mmap

Signed-off-by: Isaku Yamahata <[EMAIL PROTECTED]>

diff -r 1ad06bd6832d -r 83baf855f331 
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
--- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Tue Apr 25 
18:22:11 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Wed Apr 26 
12:21:31 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<<PAGE_SHIFT,
-                                             vma->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 1ad06bd6832d -r 83baf855f331 
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   Tue Apr 
25 18:22:11 2006 +0100
+++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h   Wed Apr 
26 12:21:31 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 1ad06bd6832d -r 83baf855f331 
linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h        Tue Apr 25 
18:22:11 2006 +0100
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h        Wed Apr 26 
12:21:31 2006 +0900
@@ -119,6 +119,7 @@ HYPERVISOR_poll(
 #define        pfn_to_mfn(x)   (x)
 #define        mfn_to_pfn(x)   (x)
 #define machine_to_phys_mapping 0
+#define xen_arch_privcmd_mmap(file, vma)       (0)
 
 // for drivers/xen/balloon/balloon.c
 #ifdef CONFIG_XEN_SCRUB_PAGES
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

Reply via email to