Example #1
0
static int
populate_page_if_necessary(int xc_handle, uint32_t dom, unsigned long gmfn,
                           struct xen_ia64_p2m_table *p2m_table)
{
    if (xc_ia64_p2m_present(p2m_table, gmfn))
        return 0;

    return xc_domain_memory_populate_physmap(xc_handle, dom, 1, 0, 0, &gmfn);
}
int arch_setup_meminit(struct xc_dom_image *dom)
{
    xen_pfn_t pfn;
    int rc;

    /* setup initial p2m */
    dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * dom->total_pages);
    for ( pfn = 0; pfn < dom->total_pages; pfn++ )
        dom->p2m_host[pfn] = pfn;

    /* allocate guest memory */
    rc = xc_domain_memory_populate_physmap(dom->guest_xc, dom->guest_domid,
                                           dom->total_pages, 0, 0,
                                           dom->p2m_host);
    return rc;
}
Example #3
0
/*
 * hvm domain requires IO pages allocated when XEN_DOMCTL_arch_setup
 */
static int
xc_ia64_hvm_domain_setup(int xc_handle, uint32_t dom)
{
    int rc;
    xen_pfn_t pfn_list[] = {
        IO_PAGE_START >> PAGE_SHIFT,
        BUFFER_IO_PAGE_START >> PAGE_SHIFT,
        BUFFER_PIO_PAGE_START >> PAGE_SHIFT,
    };
    unsigned long nr_pages = sizeof(pfn_list) / sizeof(pfn_list[0]);

    rc = xc_domain_memory_populate_physmap(xc_handle, dom, nr_pages,
                                           0, 0, &pfn_list[0]);
    if (rc != 0)
        PERROR("Could not allocate IO page or buffer io page.\n");
    return rc;
}

int
xc_domain_restore(int xc_handle, int io_fd, uint32_t dom,
                 unsigned int store_evtchn, unsigned long *store_mfn,
                 unsigned int console_evtchn, unsigned long *console_mfn,
                 unsigned int hvm, unsigned int pae)
{
    DECLARE_DOMCTL;
    int rc = 1;
    unsigned long ver;