aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xlate_mmu.c
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@citrix.com>2015-08-07 12:34:41 -0400
committerJulien Grall <julien.grall@citrix.com>2015-09-08 13:03:54 -0400
commita13d7201d7deedcbb6ac6efa94a1a7d34d3d79ec (patch)
treeccbf55b3856cac4525d13acc671a55398288cfec /drivers/xen/xlate_mmu.c
parent859e3267c515d0cc7cc11528e80a2b7f3edc3bd9 (diff)
xen/privcmd: Further s/MFN/GFN/ clean-up
The privcmd code is mixing the usage of GFN and MFN within the same functions which make the code difficult to understand when you only work with auto-translated guests. The privcmd driver is only dealing with GFN so replace all the mention of MFN into GFN. The ioctl structure used to map foreign change has been left unchanged given that the userspace is using it. Nonetheless, add a comment to explain the expected value within the "mfn" field. Signed-off-by: Julien Grall <julien.grall@citrix.com> Reviewed-by: David Vrabel <david.vrabel@citrix.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen/xlate_mmu.c')
-rw-r--r--drivers/xen/xlate_mmu.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/xen/xlate_mmu.c b/drivers/xen/xlate_mmu.c
index 58a5389aec89..cff23872c5a9 100644
--- a/drivers/xen/xlate_mmu.c
+++ b/drivers/xen/xlate_mmu.c
@@ -38,8 +38,8 @@
38#include <xen/interface/xen.h> 38#include <xen/interface/xen.h>
39#include <xen/interface/memory.h> 39#include <xen/interface/memory.h>
40 40
41/* map fgmfn of domid to lpfn in the current domain */ 41/* map fgfn of domid to lpfn in the current domain */
42static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn, 42static int map_foreign_page(unsigned long lpfn, unsigned long fgfn,
43 unsigned int domid) 43 unsigned int domid)
44{ 44{
45 int rc; 45 int rc;
@@ -49,7 +49,7 @@ static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn,
49 .size = 1, 49 .size = 1,
50 .space = XENMAPSPACE_gmfn_foreign, 50 .space = XENMAPSPACE_gmfn_foreign,
51 }; 51 };
52 xen_ulong_t idx = fgmfn; 52 xen_ulong_t idx = fgfn;
53 xen_pfn_t gpfn = lpfn; 53 xen_pfn_t gpfn = lpfn;
54 int err = 0; 54 int err = 0;
55 55
@@ -62,13 +62,13 @@ static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn,
62} 62}
63 63
64struct remap_data { 64struct remap_data {
65 xen_pfn_t *fgmfn; /* foreign domain's gmfn */ 65 xen_pfn_t *fgfn; /* foreign domain's gfn */
66 pgprot_t prot; 66 pgprot_t prot;
67 domid_t domid; 67 domid_t domid;
68 struct vm_area_struct *vma; 68 struct vm_area_struct *vma;
69 int index; 69 int index;
70 struct page **pages; 70 struct page **pages;
71 struct xen_remap_mfn_info *info; 71 struct xen_remap_gfn_info *info;
72 int *err_ptr; 72 int *err_ptr;
73 int mapped; 73 int mapped;
74}; 74};
@@ -82,20 +82,20 @@ static int remap_pte_fn(pte_t *ptep, pgtable_t token, unsigned long addr,
82 pte_t pte = pte_mkspecial(pfn_pte(pfn, info->prot)); 82 pte_t pte = pte_mkspecial(pfn_pte(pfn, info->prot));
83 int rc; 83 int rc;
84 84
85 rc = map_foreign_page(pfn, *info->fgmfn, info->domid); 85 rc = map_foreign_page(pfn, *info->fgfn, info->domid);
86 *info->err_ptr++ = rc; 86 *info->err_ptr++ = rc;
87 if (!rc) { 87 if (!rc) {
88 set_pte_at(info->vma->vm_mm, addr, ptep, pte); 88 set_pte_at(info->vma->vm_mm, addr, ptep, pte);
89 info->mapped++; 89 info->mapped++;
90 } 90 }
91 info->fgmfn++; 91 info->fgfn++;
92 92
93 return 0; 93 return 0;
94} 94}
95 95
96int xen_xlate_remap_gfn_array(struct vm_area_struct *vma, 96int xen_xlate_remap_gfn_array(struct vm_area_struct *vma,
97 unsigned long addr, 97 unsigned long addr,
98 xen_pfn_t *mfn, int nr, 98 xen_pfn_t *gfn, int nr,
99 int *err_ptr, pgprot_t prot, 99 int *err_ptr, pgprot_t prot,
100 unsigned domid, 100 unsigned domid,
101 struct page **pages) 101 struct page **pages)
@@ -108,7 +108,7 @@ int xen_xlate_remap_gfn_array(struct vm_area_struct *vma,
108 x86 PVOPS */ 108 x86 PVOPS */
109 BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_IO)) == (VM_PFNMAP | VM_IO))); 109 BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_IO)) == (VM_PFNMAP | VM_IO)));
110 110
111 data.fgmfn = mfn; 111 data.fgfn = gfn;
112 data.prot = prot; 112 data.prot = prot;
113 data.domid = domid; 113 data.domid = domid;
114 data.vma = vma; 114 data.vma = vma;