aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-11-11 15:37:43 -0500
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-11-11 15:37:43 -0500
commite060e7af98182494b764d002eba7fa022fe91bdf (patch)
tree556b1a8c0d5cddf245c18bf220259691fb8f31d3
parent313e74412105c670ff8900ec8099a3a5df1fa83c (diff)
xen: set vma flag VM_PFNMAP in the privcmd mmap file_op
Set VM_PFNMAP in the privcmd mmap file_op, rather than later in xen_remap_domain_mfn_range when it is too late because vma_wants_writenotify has already been called and vm_page_prot has already been modified. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
-rw-r--r--arch/x86/xen/mmu.c3
-rw-r--r--drivers/xen/xenfs/privcmd.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index f08ea045620f..792de4349c79 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2299,7 +2299,8 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
2299 2299
2300 prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP); 2300 prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP);
2301 2301
2302 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; 2302 BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_RESERVED | VM_IO)) ==
2303 (VM_PFNMAP | VM_RESERVED | VM_IO)));
2303 2304
2304 rmd.mfn = mfn; 2305 rmd.mfn = mfn;
2305 rmd.prot = prot; 2306 rmd.prot = prot;
diff --git a/drivers/xen/xenfs/privcmd.c b/drivers/xen/xenfs/privcmd.c
index 2eb04c842511..88474d460d82 100644
--- a/drivers/xen/xenfs/privcmd.c
+++ b/drivers/xen/xenfs/privcmd.c
@@ -380,8 +380,9 @@ static int privcmd_mmap(struct file *file, struct vm_area_struct *vma)
380 if (xen_feature(XENFEAT_auto_translated_physmap)) 380 if (xen_feature(XENFEAT_auto_translated_physmap))
381 return -ENOSYS; 381 return -ENOSYS;
382 382
383 /* DONTCOPY is essential for Xen as copy_page_range is broken. */ 383 /* DONTCOPY is essential for Xen because copy_page_range doesn't know
384 vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY; 384 * how to recreate these mappings */
385 vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY | VM_PFNMAP;
385 vma->vm_ops = &privcmd_vm_ops; 386 vma->vm_ops = &privcmd_vm_ops;
386 vma->vm_private_data = NULL; 387 vma->vm_private_data = NULL;
387 388