Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen: add pages parameter to xen_remap_domain_mfn_range

Also introduce xen_unmap_domain_mfn_range. These are the parts of
Mukesh's "xen/pvh: Implement MMU changes for PVH" which are also
needed as a baseline for ARM privcmd support.

The original patch was:

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

This derivative is also:

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

+21 -4
+14 -1
arch/x86/xen/mmu.c
··· 2479 2479 int xen_remap_domain_mfn_range(struct vm_area_struct *vma, 2480 2480 unsigned long addr, 2481 2481 unsigned long mfn, int nr, 2482 - pgprot_t prot, unsigned domid) 2482 + pgprot_t prot, unsigned domid, 2483 + struct page **pages) 2484 + 2483 2485 { 2484 2486 struct remap_data rmd; 2485 2487 struct mmu_update mmu_update[REMAP_BATCH_SIZE]; ··· 2525 2523 return err; 2526 2524 } 2527 2525 EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range); 2526 + 2527 + /* Returns: 0 success */ 2528 + int xen_unmap_domain_mfn_range(struct vm_area_struct *vma, 2529 + int numpgs, struct page **pages) 2530 + { 2531 + if (!pages || !xen_feature(XENFEAT_auto_translated_physmap)) 2532 + return 0; 2533 + 2534 + return -EINVAL; 2535 + } 2536 + EXPORT_SYMBOL_GPL(xen_unmap_domain_mfn_range);
+3 -2
drivers/xen/privcmd.c
··· 178 178 msg->va & PAGE_MASK, 179 179 msg->mfn, msg->npages, 180 180 vma->vm_page_prot, 181 - st->domain); 181 + st->domain, NULL); 182 182 if (rc < 0) 183 183 return rc; 184 184 ··· 267 267 int ret; 268 268 269 269 ret = xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK, *mfnp, 1, 270 - st->vma->vm_page_prot, st->domain); 270 + st->vma->vm_page_prot, st->domain, 271 + NULL); 271 272 272 273 /* Store error code for second pass. */ 273 274 *(st->err++) = ret;
+4 -1
include/xen/xen-ops.h
··· 27 27 int xen_remap_domain_mfn_range(struct vm_area_struct *vma, 28 28 unsigned long addr, 29 29 unsigned long mfn, int nr, 30 - pgprot_t prot, unsigned domid); 30 + pgprot_t prot, unsigned domid, 31 + struct page **pages); 32 + int xen_unmap_domain_mfn_range(struct vm_area_struct *vma, 33 + int numpgs, struct page **pages); 31 34 32 35 #endif /* INCLUDE_XEN_OPS_H */