Commit d51e8b3e authored by Juergen Gross's avatar Juergen Gross Committed by David Vrabel

xen: don't build mfn tree if tools don't need it

In case the Xen tools indicate they don't need the p2m 3 level tree
as they support the virtual mapped linear p2m list, just omit building
the tree.
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Acked-by: default avatarKonrad Rzeszutek Wilk <Konrad.wilk@oracle.com>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent 4b9c9a11
...@@ -199,7 +199,8 @@ void __ref xen_build_mfn_list_list(void) ...@@ -199,7 +199,8 @@ void __ref xen_build_mfn_list_list(void)
unsigned int level, topidx, mididx; unsigned int level, topidx, mididx;
unsigned long *mid_mfn_p; unsigned long *mid_mfn_p;
if (xen_feature(XENFEAT_auto_translated_physmap)) if (xen_feature(XENFEAT_auto_translated_physmap) ||
xen_start_info->flags & SIF_VIRT_P2M_4TOOLS)
return; return;
/* Pre-initialize p2m_top_mfn to be completely missing */ /* Pre-initialize p2m_top_mfn to be completely missing */
...@@ -260,8 +261,11 @@ void xen_setup_mfn_list_list(void) ...@@ -260,8 +261,11 @@ void xen_setup_mfn_list_list(void)
BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info); BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info);
HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list = if (xen_start_info->flags & SIF_VIRT_P2M_4TOOLS)
virt_to_mfn(p2m_top_mfn); HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list = ~0UL;
else
HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list =
virt_to_mfn(p2m_top_mfn);
HYPERVISOR_shared_info->arch.max_pfn = xen_max_p2m_pfn; HYPERVISOR_shared_info->arch.max_pfn = xen_max_p2m_pfn;
HYPERVISOR_shared_info->arch.p2m_generation = 0; HYPERVISOR_shared_info->arch.p2m_generation = 0;
HYPERVISOR_shared_info->arch.p2m_vaddr = (unsigned long)xen_p2m_addr; HYPERVISOR_shared_info->arch.p2m_vaddr = (unsigned long)xen_p2m_addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment