[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v1 2/8]: PVH mmu changes
On Fri, 21 Sep 2012, Mukesh Rathor wrote: > +struct pvh_remap_data { > + unsigned long fgmfn; /* foreign domain's gmfn */ > + pgprot_t prot; > + domid_t domid; > + struct xen_pvh_pfn_info *pvhinfop; > +}; > + > +static int pvh_map_pte_fn(pte_t *ptep, pgtable_t token, unsigned long addr, > + void *data) > +{ > + int rc; > + struct pvh_remap_data *remapp = data; > + struct xen_pvh_pfn_info *pvhp = remapp->pvhinfop; > + unsigned long pfn = page_to_pfn(pvhp->pi_paga[pvhp->pi_next_todo++]); > + pte_t pteval = pte_mkspecial(pfn_pte(pfn, remapp->prot)); > + > + if ((rc=pvh_add_to_xen_p2m(pfn, remapp->fgmfn, remapp->domid))) > + return rc; > + native_set_pte(ptep, pteval); > + > + return 0; > +} > + > +/* The only caller at moment passes one gmfn at a time. > + * PVH TBD/FIXME: expand this in future to honor batch requests. > + */ > +static int pvh_remap_gmfn_range(struct vm_area_struct *vma, > + unsigned long addr, unsigned long mfn, int nr, > + pgprot_t prot, unsigned domid, > + struct xen_pvh_pfn_info *pvhp) > +{ > + int err; > + struct pvh_remap_data pvhdata; > + > + if (nr > 1) > + return -EINVAL; > + > + pvhdata.fgmfn = mfn; > + pvhdata.prot = prot; > + pvhdata.domid = domid; > + pvhdata.pvhinfop = pvhp; > + err = apply_to_page_range(vma->vm_mm, addr, nr << PAGE_SHIFT, > + pvh_map_pte_fn, &pvhdata); > + flush_tlb_all(); > + return err; > +} > + > #define REMAP_BATCH_SIZE 16 > > struct remap_data { > @@ -2329,7 +2468,9 @@ static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t > token, > int xen_remap_domain_mfn_range(struct vm_area_struct *vma, > unsigned long addr, > unsigned long mfn, int nr, > - pgprot_t prot, unsigned domid) > + pgprot_t prot, unsigned domid, > + struct xen_pvh_pfn_info *pvhp) > + xen_remap_domain_mfn_range is a cross-architecture call (it is available on ARM as well). We cannot leak architecture specific informations like xen_pvh_pfn_info in the parameter list. It seems to be that xen_pvh_pfn_info contains arch-agnostic information: in that case you just need to rename the struct to something more generic. Otherwise if it really contains x86 specific info, you can change it into an opaque pointer. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |