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

[Xen-devel] [PATCH 1/3] x86/dom0: use dom0_paging_pages to account for the memory used by IOMMU pt



Instead of open coding a calculation for it.

Signed-off-by: Roger PAu Monné <roger.pau@xxxxxxxxxx>
---
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/dom0_build.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index f616b99ddc..c997f5e6f5 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -254,14 +254,9 @@ unsigned long __init dom0_compute_nr_pages(
     if ( is_pv_32bit_domain(d) )
         avail -= d->max_vcpus - 1;
 
-    /* Reserve memory for iommu_dom0_init() (rough estimate). */
+    /* Reserve memory for iommu_dom0_init(). */
     if ( iommu_enabled )
-    {
-        unsigned int s;
-
-        for ( s = 9; s < BITS_PER_LONG; s += 9 )
-            avail -= max_pdx >> s;
-    }
+        avail -= dom0_paging_pages(d, max_pdx);
 
     need_paging = is_hvm_domain(d) &&
         (!iommu_hap_pt_share || !paging_mode_hap(d));
-- 
2.13.5 (Apple Git-94)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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