grant_table_version);
}
-int gnttab_resume(void)
+ static int xlated_setup_gnttab_pages(int numpages, void **addr)
+ {
+ int i, rc;
+ unsigned long pfns[numpages];
+ struct page *pages[numpages];
+
+ rc = alloc_xenballooned_pages(numpages, pages, 0);
+ if (rc != 0) {
+ pr_warn("%s Could not balloon alloc %d pfns rc:%d\n", __func__,
+ numpages, rc);
+ return -ENOMEM;
+ }
+ for (i = 0; i < numpages; i++)
+ pfns[i] = page_to_pfn(pages[i]);
+
+ rc = arch_gnttab_map_shared(pfns, numpages, numpages, addr);
+ return rc;
+ }
+
+static int gnttab_setup(void)
{
- unsigned int max_nr_gframes;
- char *kmsg = "Failed to kmalloc pages for pv in hvm grant frames\n";
+ unsigned int rc, max_nr_gframes;
- gnttab_request_version();
max_nr_gframes = gnttab_max_grant_frames();
if (max_nr_gframes < nr_grant_frames)
return -ENOSYS;