unsigned int domid)
{
int rc;
- struct xen_add_to_physmap xatp = { .foreign_domid = domid };
+ struct xen_add_to_physmap_range xatp = {
+ .domid = DOMID_SELF,
+ .foreign_domid = domid,
+ .size = 1,
+ .space = XENMAPSPACE_gmfn_foreign,
+ };
+ xen_ulong_t idx = fgmfn;
+ xen_pfn_t gpfn = lpfn;
+
+ set_xen_guest_handle(xatp.idxs, &idx);
+ set_xen_guest_handle(xatp.gpfns, &gpfn);
- xatp.gpfn = lpfn;
- xatp.idx = fgmfn;
- xatp.domid = DOMID_SELF;
- xatp.space = XENMAPSPACE_gmfn_foreign;
- rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp);
+ rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap_range, &xatp);
if (rc)
pr_warn("d0: Failed to map pfn (0x%lx) to mfn (0x%lx) rc:%d\n",
lpfn, fgmfn, rc);
uint16_t size;
/* Source mapping space. */
- uint16_t space;
- domid_t foreign_domid; /* IFF XENMAPSPACE_gmfn_foreign */
-
-#define XENMAPIDX_grant_table_status 0x80000000
+ unsigned int space;
/* Index into source mapping space. */
xen_ulong_t idx;