Instead of open coding a calculation for it.

Signed-off-by: Roger PAu Monné <roger....@citrix.com>
---
Cc: Jan Beulich <jbeul...@suse.com>
Cc: Andrew Cooper <andrew.coop...@citrix.com>
---
 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@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to