[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] PVH dom0 memory setup

On Fri, Sep 08, 2017 at 10:56:33AM -0400, Boris Ostrovsky wrote:
> I am slightly confused by the use of 'need_paging' variable in
> dom0_compute_nr_pages().
> Because paging_mode_hap() and iommu_hap_pt_share are (almost?) always
> true, we are not reducing available memory for PVH dom0 by page tables
> size. But then in pvh_setup_p2m() we do use this memory by
> paging_set_allocation(). And from what I've seen we then may run our of
> heap pages when populating memory map (in the 'for' loop below).
> Am I not reading this correctly?

Yes, I think you are reading this correctly. dom0_compute_nr_pages
should set need_paging if the domain type is hvm AFAICT, because hap
also consumes memory for it's page tables. Do you have a reliable way
to trigger this?

I was thinking of a fix along the lines of:

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index f616b99ddc..424192a7c4 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -263,8 +263,7 @@ unsigned long __init dom0_compute_nr_pages(
             avail -= max_pdx >> s;
-    need_paging = is_hvm_domain(d) &&
-        (!iommu_hap_pt_share || !paging_mode_hap(d));
+    need_paging = is_hvm_domain(d);
     for ( ; ; need_paging = false )
         nr_pages = dom0_nrpages;

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.