Linux may not use the same page granularity as Xen. This will result to
a domain crash because it will try to map more page than required.
As the xenstore page size willl always be equal to a Xen page size, use
XC_PAGE_SIZE.
Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE);
} else {
return xc_map_foreign_range(*xc_handle, domid,
- getpagesize(), PROT_READ|PROT_WRITE, mfn);
+ XC_PAGE_SIZE, PROT_READ|PROT_WRITE, mfn);
}
}
if (*xcg_handle != NULL)
xc_gnttab_munmap(*xcg_handle, interface, 1);
else
- munmap(interface, getpagesize());
+ munmap(interface, XC_PAGE_SIZE);
}
static int destroy_domain(void *_domain)