/* --- arch specific hooks ----------------------------------------- */
struct xc_dom_arch {
- /* pagetable setup */
int (*alloc_magic_pages) (struct xc_dom_image * dom);
+
+ /* pagetable setup - x86 PV only */
int (*alloc_pgtables) (struct xc_dom_image * dom);
int (*alloc_p2m_list) (struct xc_dom_image * dom);
int (*setup_pgtables) (struct xc_dom_image * dom);
return XEN_IO_PROTO_ABI_ARM;
}
-/* ------------------------------------------------------------------------ */
-/*
- * arm guests are hybrid and start off with paging disabled, therefore no
- * pagetables and nothing to do here.
- */
-static int alloc_pgtables_arm(struct xc_dom_image *dom)
-{
- DOMPRINTF_CALLED(dom->xch);
- return 0;
-}
-
-static int setup_pgtables_arm(struct xc_dom_image *dom)
-{
- DOMPRINTF_CALLED(dom->xch);
- return 0;
-}
-
/* ------------------------------------------------------------------------ */
static int alloc_magic_pages(struct xc_dom_image *dom)
.page_shift = PAGE_SHIFT_ARM,
.sizeof_pfn = 8,
.alloc_magic_pages = alloc_magic_pages,
- .alloc_pgtables = alloc_pgtables_arm,
- .setup_pgtables = setup_pgtables_arm,
.start_info = start_info_arm,
.shared_info = shared_info_arm,
.vcpu = vcpu_arm32,
.page_shift = PAGE_SHIFT_ARM,
.sizeof_pfn = 8,
.alloc_magic_pages = alloc_magic_pages,
- .alloc_pgtables = alloc_pgtables_arm,
- .setup_pgtables = setup_pgtables_arm,
.start_info = start_info_arm,
.shared_info = shared_info_arm,
.vcpu = vcpu_arm64,
/* initial mm setup */
if ( (rc = xc_dom_update_guest_p2m(dom)) != 0 )
return rc;
- if ( dom->arch_hooks->setup_pgtables )
- if ( (rc = dom->arch_hooks->setup_pgtables(dom)) != 0 )
- return rc;
+ if ( dom->arch_hooks->setup_pgtables &&
+ (rc = dom->arch_hooks->setup_pgtables(dom)) != 0 )
+ return rc;
/* start info page */
if ( dom->arch_hooks->start_info )
goto err;
if ( dom->arch_hooks->alloc_magic_pages(dom) != 0 )
goto err;
- if ( dom->arch_hooks->alloc_pgtables(dom) != 0 )
+ if ( dom->arch_hooks->alloc_pgtables &&
+ dom->arch_hooks->alloc_pgtables(dom) != 0 )
goto err;
if ( dom->alloc_bootstack )
{
return 0;
}
-static int alloc_pgtables_hvm(struct xc_dom_image *dom)
-{
- DOMPRINTF("%s: doing nothing", __func__);
- return 0;
-}
-
/*
* The memory layout of the start_info page and the modules, and where the
* addresses are stored:
.page_shift = PAGE_SHIFT_X86,
.sizeof_pfn = 4,
.alloc_magic_pages = alloc_magic_pages_hvm,
- .alloc_pgtables = alloc_pgtables_hvm,
.vcpu = vcpu_hvm,
.meminit = meminit_hvm,
.bootearly = bootearly,