Lines Matching refs:dom

139 static int count_pgtables(struct xc_dom_image *dom, xen_vaddr_t from,  in count_pgtables()  argument
142 struct xc_dom_image_x86 *domx86 = dom->arch_private; in count_pgtables()
151 xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY, in count_pgtables()
158 if ( pfn_end >= dom->p2m_size ) in count_pgtables()
160 xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY, in count_pgtables()
162 __FUNCTION__, pfn_end, dom->p2m_size); in count_pgtables()
170 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in count_pgtables()
182 map->lvls[l].pfn = dom->pfn_alloc_end + map->area.pgtables; in count_pgtables()
241 static int alloc_pgtables_pv(struct xc_dom_image *dom) in alloc_pgtables_pv() argument
245 struct xc_dom_image_x86 *domx86 = dom->arch_private; in alloc_pgtables_pv()
248 extra_pages = dom->alloc_bootstack ? 1 : 0; in alloc_pgtables_pv()
253 try_virt_end = round_up(dom->virt_alloc_end + pages * PAGE_SIZE_X86, in alloc_pgtables_pv()
256 if ( count_pgtables(dom, dom->parms.virt_base, try_virt_end, 0) ) in alloc_pgtables_pv()
260 if ( dom->virt_alloc_end + pages * PAGE_SIZE_X86 <= try_virt_end + 1 ) in alloc_pgtables_pv()
265 dom->virt_pgtab_end = try_virt_end + 1; in alloc_pgtables_pv()
267 return xc_dom_alloc_segment(dom, &dom->pgtables_seg, "page tables", 0, in alloc_pgtables_pv()
274 static int alloc_pgtables_x86_32_pae(struct xc_dom_image *dom) in alloc_pgtables_x86_32_pae() argument
287 struct xc_dom_image_x86 *domx86 = dom->arch_private; in alloc_pgtables_x86_32_pae()
291 return alloc_pgtables_pv(dom); in alloc_pgtables_x86_32_pae()
302 static xen_pfn_t move_l3_below_4G(struct xc_dom_image *dom, in move_l3_below_4G() argument
306 struct xc_dom_image_x86 *domx86 = dom->arch_private; in move_l3_below_4G()
312 mmu = xc_alloc_mmu_updates(dom->xch, dom->guest_domid); in move_l3_below_4G()
319 xc_dom_unmap_one(dom, l3pfn); in move_l3_below_4G()
321 new_l3mfn = xc_make_page_below_4G(dom->xch, dom->guest_domid, l3mfn); in move_l3_below_4G()
325 p2m_guest[l3pfn] = dom->pv_p2m[l3pfn] = new_l3mfn; in move_l3_below_4G()
327 if ( xc_add_mmu_update(dom->xch, mmu, in move_l3_below_4G()
329 << XC_DOM_PAGE_SHIFT(dom)) | in move_l3_below_4G()
333 if ( xc_flush_mmu_updates(dom->xch, mmu) ) in move_l3_below_4G()
341 if ( xc_dom_seg_to_ptr(dom, &dom->pgtables_seg) == NULL ) in move_l3_below_4G()
344 l3tab = xc_dom_pfn_to_ptr(dom, l3pfn, 1); in move_l3_below_4G()
351 memset(l3tab, 0, XC_DOM_PAGE_SIZE(dom)); in move_l3_below_4G()
365 static x86_pgentry_t *get_pg_table(struct xc_dom_image *dom, int m, int l) in get_pg_table() argument
367 struct xc_dom_image_x86 *domx86 = dom->arch_private; in get_pg_table()
372 pg = xc_dom_pfn_to_ptr(dom, map->lvls[l].pfn, 0); in get_pg_table()
376 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in get_pg_table()
381 static x86_pgentry_t get_pg_prot(struct xc_dom_image *dom, int l, xen_pfn_t pfn) in get_pg_prot() argument
383 struct xc_dom_image_x86 *domx86 = dom->arch_private; in get_pg_prot()
405 static int setup_pgtables_pv(struct xc_dom_image *dom) in setup_pgtables_pv() argument
407 struct xc_dom_image_x86 *domx86 = dom->arch_private; in setup_pgtables_pv()
422 pg = get_pg_table(dom, m1, l); in setup_pgtables_pv()
441 pg[p] = pfn_to_paddr(xc_dom_p2m(dom, pfn)) | in setup_pgtables_pv()
442 get_pg_prot(dom, l, pfn); in setup_pgtables_pv()
451 static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom) in setup_pgtables_x86_32_pae() argument
453 struct xc_dom_image_x86 *domx86 = dom->arch_private; in setup_pgtables_x86_32_pae()
458 for ( i = 0; i < dom->p2m_size; ++i ) in setup_pgtables_x86_32_pae()
460 if ( dom->pv_p2m[i] != INVALID_PFN ) in setup_pgtables_x86_32_pae()
461 p2m_guest[i] = dom->pv_p2m[i]; in setup_pgtables_x86_32_pae()
467 l3mfn = xc_dom_p2m(dom, l3pfn); in setup_pgtables_x86_32_pae()
468 if ( dom->parms.pae == XEN_PAE_YES ) in setup_pgtables_x86_32_pae()
471 l3mfn = move_l3_below_4G(dom, l3pfn, l3mfn); in setup_pgtables_x86_32_pae()
475 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,"%s: cannot move L3" in setup_pgtables_x86_32_pae()
483 return setup_pgtables_pv(dom); in setup_pgtables_x86_32_pae()
489 static int alloc_pgtables_x86_64(struct xc_dom_image *dom) in alloc_pgtables_x86_64() argument
498 struct xc_dom_image_x86 *domx86 = dom->arch_private; in alloc_pgtables_x86_64()
502 return alloc_pgtables_pv(dom); in alloc_pgtables_x86_64()
505 static int setup_pgtables_x86_64(struct xc_dom_image *dom) in setup_pgtables_x86_64() argument
507 struct xc_dom_image_x86 *domx86 = dom->arch_private; in setup_pgtables_x86_64()
512 for ( i = 0; i < dom->p2m_size; ++i ) in setup_pgtables_x86_64()
514 if ( dom->pv_p2m[i] != INVALID_PFN ) in setup_pgtables_x86_64()
515 p2m_guest[i] = dom->pv_p2m[i]; in setup_pgtables_x86_64()
520 return setup_pgtables_pv(dom); in setup_pgtables_x86_64()
525 static int alloc_p2m_list(struct xc_dom_image *dom, size_t p2m_alloc_size) in alloc_p2m_list() argument
527 struct xc_dom_image_x86 *domx86 = dom->arch_private; in alloc_p2m_list()
529 if ( xc_dom_alloc_segment(dom, &dom->p2m_seg, "phys2mach", in alloc_p2m_list()
533 domx86->p2m_guest = xc_dom_seg_to_ptr(dom, &dom->p2m_seg); in alloc_p2m_list()
540 static int alloc_p2m_list_x86_32(struct xc_dom_image *dom) in alloc_p2m_list_x86_32() argument
542 size_t p2m_alloc_size = dom->p2m_size * dom->arch_hooks->sizeof_pfn; in alloc_p2m_list_x86_32()
545 return alloc_p2m_list(dom, p2m_alloc_size); in alloc_p2m_list_x86_32()
548 static int alloc_p2m_list_x86_64(struct xc_dom_image *dom) in alloc_p2m_list_x86_64() argument
550 struct xc_dom_image_x86 *domx86 = dom->arch_private; in alloc_p2m_list_x86_64()
552 size_t p2m_alloc_size = dom->p2m_size * dom->arch_hooks->sizeof_pfn; in alloc_p2m_list_x86_64()
557 if ( dom->parms.p2m_base != UNSET_ADDR ) in alloc_p2m_list_x86_64()
559 from = dom->parms.p2m_base; in alloc_p2m_list_x86_64()
561 if ( count_pgtables(dom, from, to, dom->pfn_alloc_end) ) in alloc_p2m_list_x86_64()
564 map->area.pfn = dom->pfn_alloc_end; in alloc_p2m_list_x86_64()
571 return alloc_p2m_list(dom, p2m_alloc_size); in alloc_p2m_list_x86_64()
576 static int alloc_magic_pages_pv(struct xc_dom_image *dom) in alloc_magic_pages_pv() argument
578 dom->start_info_pfn = xc_dom_alloc_page(dom, "start info"); in alloc_magic_pages_pv()
579 if ( dom->start_info_pfn == INVALID_PFN ) in alloc_magic_pages_pv()
582 dom->xenstore_pfn = xc_dom_alloc_page(dom, "xenstore"); in alloc_magic_pages_pv()
583 if ( dom->xenstore_pfn == INVALID_PFN ) in alloc_magic_pages_pv()
585 xc_clear_domain_page(dom->xch, dom->guest_domid, in alloc_magic_pages_pv()
586 xc_dom_p2m(dom, dom->xenstore_pfn)); in alloc_magic_pages_pv()
588 dom->console_pfn = xc_dom_alloc_page(dom, "console"); in alloc_magic_pages_pv()
589 if ( dom->console_pfn == INVALID_PFN ) in alloc_magic_pages_pv()
591 xc_clear_domain_page(dom->xch, dom->guest_domid, in alloc_magic_pages_pv()
592 xc_dom_p2m(dom, dom->console_pfn)); in alloc_magic_pages_pv()
594 dom->alloc_bootstack = 1; in alloc_magic_pages_pv()
599 static void build_hvm_info(void *hvm_info_page, struct xc_dom_image *dom) in build_hvm_info() argument
618 hvm_info->low_mem_pgend = dom->lowmem_end >> PAGE_SHIFT; in build_hvm_info()
619 hvm_info->high_mem_pgend = dom->highmem_end >> PAGE_SHIFT; in build_hvm_info()
628 static int alloc_magic_pages_hvm(struct xc_dom_image *dom) in alloc_magic_pages_hvm() argument
631 uint32_t *ident_pt, domid = dom->guest_domid; in alloc_magic_pages_hvm()
635 xc_interface *xch = dom->xch; in alloc_magic_pages_hvm()
676 dom->e820_entries * sizeof(struct hvm_memmap_table_entry); in alloc_magic_pages_hvm()
678 if ( !dom->device_model ) in alloc_magic_pages_hvm()
680 if ( dom->cmdline ) in alloc_magic_pages_hvm()
682 dom->cmdline_size = ROUNDUP(strlen(dom->cmdline) + 1, 8); in alloc_magic_pages_hvm()
683 start_info_size += dom->cmdline_size; in alloc_magic_pages_hvm()
714 rc = xc_dom_alloc_segment(dom, &dom->start_info_seg, in alloc_magic_pages_hvm()
737 dom->console_pfn = special_pfn(SPECIALPAGE_CONSOLE); in alloc_magic_pages_hvm()
738 xc_clear_domain_page(dom->xch, dom->guest_domid, dom->console_pfn); in alloc_magic_pages_hvm()
740 dom->xenstore_pfn = special_pfn(SPECIALPAGE_XENSTORE); in alloc_magic_pages_hvm()
741 xc_clear_domain_page(dom->xch, dom->guest_domid, dom->xenstore_pfn); in alloc_magic_pages_hvm()
743 dom->parms.virt_hypercall = -1; in alloc_magic_pages_hvm()
756 static int start_info_x86_32(struct xc_dom_image *dom) in start_info_x86_32() argument
758 struct xc_dom_image_x86 *domx86 = dom->arch_private; in start_info_x86_32()
760 xc_dom_pfn_to_ptr(dom, dom->start_info_pfn, 1); in start_info_x86_32()
762 xc_dom_translated(dom) ? dom->shared_info_pfn : dom->shared_info_mfn; in start_info_x86_32()
764 DOMPRINTF_CALLED(dom->xch); in start_info_x86_32()
773 strncpy(start_info->magic, dom->guest_type, sizeof(start_info->magic)); in start_info_x86_32()
775 start_info->nr_pages = dom->total_pages; in start_info_x86_32()
777 start_info->pt_base = dom->pgtables_seg.vstart; in start_info_x86_32()
779 start_info->mfn_list = dom->p2m_seg.vstart; in start_info_x86_32()
781 start_info->flags = dom->flags; in start_info_x86_32()
782 start_info->store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn); in start_info_x86_32()
783 start_info->store_evtchn = dom->xenstore_evtchn; in start_info_x86_32()
784 start_info->console.domU.mfn = xc_dom_p2m(dom, dom->console_pfn); in start_info_x86_32()
785 start_info->console.domU.evtchn = dom->console_evtchn; in start_info_x86_32()
787 if ( dom->modules[0].blob ) in start_info_x86_32()
789 start_info->mod_start = dom->initrd_start; in start_info_x86_32()
790 start_info->mod_len = dom->initrd_len; in start_info_x86_32()
793 if ( dom->cmdline ) in start_info_x86_32()
795 strncpy((char *)start_info->cmd_line, dom->cmdline, MAX_GUEST_CMDLINE); in start_info_x86_32()
802 static int start_info_x86_64(struct xc_dom_image *dom) in start_info_x86_64() argument
804 struct xc_dom_image_x86 *domx86 = dom->arch_private; in start_info_x86_64()
806 xc_dom_pfn_to_ptr(dom, dom->start_info_pfn, 1); in start_info_x86_64()
808 xc_dom_translated(dom) ? dom->shared_info_pfn : dom->shared_info_mfn; in start_info_x86_64()
810 DOMPRINTF_CALLED(dom->xch); in start_info_x86_64()
819 strncpy(start_info->magic, dom->guest_type, sizeof(start_info->magic)); in start_info_x86_64()
821 start_info->nr_pages = dom->total_pages; in start_info_x86_64()
823 start_info->pt_base = dom->pgtables_seg.vstart; in start_info_x86_64()
825 start_info->mfn_list = dom->p2m_seg.vstart; in start_info_x86_64()
826 if ( dom->parms.p2m_base != UNSET_ADDR ) in start_info_x86_64()
828 start_info->first_p2m_pfn = dom->p2m_seg.pfn; in start_info_x86_64()
829 start_info->nr_p2m_frames = dom->p2m_seg.pages; in start_info_x86_64()
832 start_info->flags = dom->flags; in start_info_x86_64()
833 start_info->store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn); in start_info_x86_64()
834 start_info->store_evtchn = dom->xenstore_evtchn; in start_info_x86_64()
835 start_info->console.domU.mfn = xc_dom_p2m(dom, dom->console_pfn); in start_info_x86_64()
836 start_info->console.domU.evtchn = dom->console_evtchn; in start_info_x86_64()
838 if ( dom->modules[0].blob ) in start_info_x86_64()
840 start_info->mod_start = dom->initrd_start; in start_info_x86_64()
841 start_info->mod_len = dom->initrd_len; in start_info_x86_64()
844 if ( dom->cmdline ) in start_info_x86_64()
846 strncpy((char *)start_info->cmd_line, dom->cmdline, MAX_GUEST_CMDLINE); in start_info_x86_64()
853 static int shared_info_x86_32(struct xc_dom_image *dom, void *ptr) in shared_info_x86_32() argument
858 DOMPRINTF_CALLED(dom->xch); in shared_info_x86_32()
866 static int shared_info_x86_64(struct xc_dom_image *dom, void *ptr) in shared_info_x86_64() argument
871 DOMPRINTF_CALLED(dom->xch); in shared_info_x86_64()
881 static int vcpu_x86_32(struct xc_dom_image *dom) in vcpu_x86_32() argument
888 DOMPRINTF_CALLED(dom->xch); in vcpu_x86_32()
893 ctxt->user_regs.eip = dom->parms.virt_entry; in vcpu_x86_32()
895 dom->parms.virt_base + (dom->bootstack_pfn + 1) * PAGE_SIZE_X86; in vcpu_x86_32()
897 dom->parms.virt_base + (dom->start_info_pfn) * PAGE_SIZE_X86; in vcpu_x86_32()
904 if ( dom->parms.pae == XEN_PAE_EXTCR3 || in vcpu_x86_32()
905 dom->parms.pae == XEN_PAE_BIMODAL ) in vcpu_x86_32()
908 cr3_pfn = xc_dom_p2m(dom, dom->pgtables_seg.pfn); in vcpu_x86_32()
911 __FUNCTION__, dom->pgtables_seg.pfn, cr3_pfn); in vcpu_x86_32()
923 rc = xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx); in vcpu_x86_32()
925 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in vcpu_x86_32()
931 static int vcpu_x86_64(struct xc_dom_image *dom) in vcpu_x86_64() argument
938 DOMPRINTF_CALLED(dom->xch); in vcpu_x86_64()
943 ctxt->user_regs.rip = dom->parms.virt_entry; in vcpu_x86_64()
945 dom->parms.virt_base + (dom->bootstack_pfn + 1) * PAGE_SIZE_X86; in vcpu_x86_64()
947 dom->parms.virt_base + (dom->start_info_pfn) * PAGE_SIZE_X86; in vcpu_x86_64()
954 cr3_pfn = xc_dom_p2m(dom, dom->pgtables_seg.pfn); in vcpu_x86_64()
957 __FUNCTION__, dom->pgtables_seg.pfn, cr3_pfn); in vcpu_x86_64()
969 rc = xc_vcpu_setcontext(dom->xch, dom->guest_domid, 0, &any_ctx); in vcpu_x86_64()
971 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in vcpu_x86_64()
991 static int vcpu_hvm(struct xc_dom_image *dom) in vcpu_hvm() argument
1004 DOMPRINTF_CALLED(dom->xch); in vcpu_hvm()
1006 assert(dom->max_vcpus); in vcpu_hvm()
1015 rc = xc_domain_hvm_getcontext(dom->xch, dom->guest_domid, NULL, 0); in vcpu_hvm()
1018 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in vcpu_hvm()
1027 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in vcpu_hvm()
1034 rc = xc_domain_hvm_getcontext(dom->xch, dom->guest_domid, full_ctx, rc); in vcpu_hvm()
1037 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in vcpu_hvm()
1074 bsp_ctx.cpu.rip = dom->parms.phys_entry; in vcpu_hvm()
1079 if ( dom->start_info_seg.pfn ) in vcpu_hvm()
1080 bsp_ctx.cpu.rbx = dom->start_info_seg.pfn << PAGE_SHIFT; in vcpu_hvm()
1088 if ( !dom->device_model ) in vcpu_hvm()
1111 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in vcpu_hvm()
1124 for ( i = 0; i < dom->max_vcpus; i++ ) in vcpu_hvm()
1127 rc = xc_domain_hvm_setcontext(dom->xch, dom->guest_domid, in vcpu_hvm()
1130 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in vcpu_hvm()
1139 rc = xc_domain_hvm_setcontext(dom->xch, dom->guest_domid, in vcpu_hvm()
1142 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in vcpu_hvm()
1183 static int meminit_pv(struct xc_dom_image *dom) in meminit_pv() argument
1194 rc = x86_compat(dom->xch, dom->guest_domid, dom->guest_type); in meminit_pv()
1199 if ( dom->claim_enabled ) in meminit_pv()
1201 rc = xc_domain_claim_pages(dom->xch, dom->guest_domid, in meminit_pv()
1202 dom->total_pages); in meminit_pv()
1218 if ( dom->nr_vmemranges == 0 ) in meminit_pv()
1223 vmemranges[0].end = (uint64_t)dom->total_pages << PAGE_SHIFT; in meminit_pv()
1233 nr_vmemranges = dom->nr_vmemranges; in meminit_pv()
1234 nr_vnodes = dom->nr_vnodes; in meminit_pv()
1235 vmemranges = dom->vmemranges; in meminit_pv()
1236 vnode_to_pnode = dom->vnode_to_pnode; in meminit_pv()
1239 total = dom->p2m_size = 0; in meminit_pv()
1243 dom->p2m_size = max(dom->p2m_size, in meminit_pv()
1246 if ( total != dom->total_pages ) in meminit_pv()
1248 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in meminit_pv()
1250 __func__, total, dom->total_pages); in meminit_pv()
1254 dom->pv_p2m = xc_dom_malloc(dom, sizeof(*dom->pv_p2m) * dom->p2m_size); in meminit_pv()
1255 if ( dom->pv_p2m == NULL ) in meminit_pv()
1257 for ( pfn = 0; pfn < dom->p2m_size; pfn++ ) in meminit_pv()
1258 dom->pv_p2m[pfn] = INVALID_PFN; in meminit_pv()
1278 dom->pv_p2m[pfn] = pfn; in meminit_pv()
1288 extents[j] = dom->pv_p2m[pfn]; in meminit_pv()
1289 rc = xc_domain_populate_physmap(dom->xch, dom->guest_domid, count, in meminit_pv()
1301 dom->pv_p2m[pfn] = mfn + k; in meminit_pv()
1309 rc = xc_domain_populate_physmap_exact(dom->xch, dom->guest_domid, in meminit_pv()
1310 allocsz, 0, memflags, &dom->pv_p2m[pfn_base + j]); in meminit_pv()
1315 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in meminit_pv()
1319 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in meminit_pv()
1330 xc_domain_claim_pages(dom->xch, dom->guest_domid, 0 /* cancel claim */); in meminit_pv()
1348 static int meminit_hvm(struct xc_dom_image *dom) in meminit_hvm() argument
1350 unsigned long i, vmemid, nr_pages = dom->total_pages; in meminit_hvm()
1352 unsigned long target_pages = dom->target_pages; in meminit_hvm()
1358 int claim_enabled = dom->claim_enabled; in meminit_hvm()
1365 xc_interface *xch = dom->xch; in meminit_hvm()
1366 uint32_t domid = dom->guest_domid; in meminit_hvm()
1371 if ( dom->nr_vmemranges == 0 ) in meminit_hvm()
1383 dummy_vmemrange[0].end = dom->lowmem_end; in meminit_hvm()
1388 if ( dom->highmem_end > (1ULL << 32) ) in meminit_hvm()
1391 dummy_vmemrange[1].end = dom->highmem_end; in meminit_hvm()
1411 nr_vmemranges = dom->nr_vmemranges; in meminit_hvm()
1412 nr_vnodes = dom->nr_vnodes; in meminit_hvm()
1413 vmemranges = dom->vmemranges; in meminit_hvm()
1414 vnode_to_pnode = dom->vnode_to_pnode; in meminit_hvm()
1436 dom->p2m_size = p2m_size; in meminit_hvm()
1446 target_pages - dom->vga_hole_size); in meminit_hvm()
1463 target_pages - dom->vga_hole_size, in meminit_hvm()
1479 if ( dom->device_model ) in meminit_hvm()
1512 if ( vmemranges[vmemid].start == 0 && dom->device_model ) in meminit_hvm()
1549 dom->mmio_start, dom->mmio_size) ) in meminit_hvm()
1652 static int bootearly(struct xc_dom_image *dom) in bootearly() argument
1654 if ( dom->container_type == XC_DOM_PV_CONTAINER && in bootearly()
1655 elf_xen_feature_get(XENFEAT_auto_translated_physmap, dom->f_active) ) in bootearly()
1665 static int bootlate_pv(struct xc_dom_image *dom) in bootlate_pv() argument
1681 if ( !strcmp(types[i].guest, dom->guest_type) ) in bootlate_pv()
1685 xc_dom_unmap_one(dom, dom->pgtables_seg.pfn); in bootlate_pv()
1686 xc_dom_unmap_one(dom, dom->p2m_seg.pfn); in bootlate_pv()
1687 rc = pin_table(dom->xch, pgd_type, in bootlate_pv()
1688 xc_dom_p2m(dom, dom->pgtables_seg.pfn), in bootlate_pv()
1689 dom->guest_domid); in bootlate_pv()
1692 xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, in bootlate_pv()
1694 __FUNCTION__, dom->pgtables_seg.pfn, rc); in bootlate_pv()
1697 shinfo = dom->shared_info_mfn; in bootlate_pv()
1701 __FUNCTION__, dom->shared_info_pfn, dom->shared_info_mfn); in bootlate_pv()
1702 shared_info = xc_map_foreign_range(dom->xch, dom->guest_domid, in bootlate_pv()
1708 dom->arch_hooks->shared_info(dom, shared_info); in bootlate_pv()
1731 static void add_module_to_list(struct xc_dom_image *dom, in add_module_to_list() argument
1739 uint64_t modlist_paddr = (dom->start_info_seg.pfn << PAGE_SHIFT) + in add_module_to_list()
1765 static int bootlate_hvm(struct xc_dom_image *dom) in bootlate_hvm() argument
1767 uint32_t domid = dom->guest_domid; in bootlate_hvm()
1768 xc_interface *xch = dom->xch; in bootlate_hvm()
1775 start_info = xc_map_foreign_range(xch, domid, dom->start_info_seg.pages << in bootlate_hvm()
1776 XC_DOM_PAGE_SHIFT(dom), in bootlate_hvm()
1778 dom->start_info_seg.pfn); in bootlate_hvm()
1785 modlist = (void*)(start_info + 1) + dom->cmdline_size; in bootlate_hvm()
1787 if ( !dom->device_model ) in bootlate_hvm()
1789 if ( dom->cmdline ) in bootlate_hvm()
1793 strncpy(cmdline, dom->cmdline, dom->cmdline_size); in bootlate_hvm()
1794 start_info->cmdline_paddr = (dom->start_info_seg.pfn << PAGE_SHIFT) + in bootlate_hvm()
1799 start_info->rsdp_paddr = dom->acpi_modules[0].guest_addr_out ? : 0; in bootlate_hvm()
1803 add_module_to_list(dom, &dom->system_firmware_module, "firmware", in bootlate_hvm()
1807 for ( i = 0; i < dom->num_modules; i++ ) in bootlate_hvm()
1810 uint64_t base = dom->parms.virt_base != UNSET_ADDR ? in bootlate_hvm()
1811 dom->parms.virt_base : 0; in bootlate_hvm()
1814 dom->modules[i].seg.vstart - base; in bootlate_hvm()
1816 dom->modules[i].seg.vend - dom->modules[i].seg.vstart; in bootlate_hvm()
1821 add_module_to_list(dom, &mod, dom->modules[i].cmdline, in bootlate_hvm()
1827 start_info->modlist_paddr = (dom->start_info_seg.pfn << PAGE_SHIFT) + in bootlate_hvm()
1842 start_info->memmap_paddr = (dom->start_info_seg.pfn << PAGE_SHIFT) + in bootlate_hvm()
1844 start_info->memmap_entries = dom->e820_entries; in bootlate_hvm()
1845 for ( i = 0; i < dom->e820_entries; i++ ) in bootlate_hvm()
1847 memmap[i].addr = dom->e820[i].addr; in bootlate_hvm()
1848 memmap[i].size = dom->e820[i].size; in bootlate_hvm()
1849 memmap[i].type = dom->e820[i].type; in bootlate_hvm()
1855 munmap(start_info, dom->start_info_seg.pages << XC_DOM_PAGE_SHIFT(dom)); in bootlate_hvm()
1857 if ( dom->device_model ) in bootlate_hvm()
1865 build_hvm_info(hvm_info_page, dom); in bootlate_hvm()
1872 bool xc_dom_translated(const struct xc_dom_image *dom) in xc_dom_translated() argument
1875 return dom->container_type == XC_DOM_HVM_CONTAINER; in xc_dom_translated()