ring_pfn = pfn;
mmap_pfn = pfn;
- ring_page = xc_map_foreign_pages(xch, domain_id, PROT_READ | PROT_WRITE,
- &mmap_pfn, 1);
- if ( !ring_page )
+ rc1 = xc_get_pfn_type_batch(xch, domain_id, 1, &mmap_pfn);
+ if ( rc1 || mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
{
- /* Map failed, populate ring page */
+ /* Page not in the physmap, try to populate it */
rc1 = xc_domain_populate_physmap_exact(xch, domain_id, 1, 0, 0,
&ring_pfn);
if ( rc1 != 0 )
PERROR("Failed to populate ring pfn\n");
goto out;
}
+ }
- mmap_pfn = ring_pfn;
- ring_page = xc_map_foreign_pages(xch, domain_id, PROT_READ | PROT_WRITE,
+ mmap_pfn = ring_pfn;
+ ring_page = xc_map_foreign_pages(xch, domain_id, PROT_READ | PROT_WRITE,
&mmap_pfn, 1);
- if ( !ring_page )
- {
- PERROR("Could not map the ring page\n");
- goto out;
- }
+ if ( !ring_page )
+ {
+ PERROR("Could not map the ring page\n");
+ goto out;
}
switch ( param )