Hi all,

I have some troubles to start xen when using dom0 in HVM mode on X86 Intel 
nuc7i5bnh 
board. After some investigation it seems that  "domheap" memory allocator is 
out of memory while 
constructing the p2m mapping  (pvh_setup_p2m).  

This misbehavior, from my understanding, is the result of wrong computation of 
number of pages 
to "give" to dom0 (dom0_compute_nr_pages function). In fact the pages needed to 
paging 
(dom0_paging_pages function)  are not reserved in this function if  IOMMU 
mappings are shareable 
with HAP(EPT) mappings. Moreover this memory (for paging needs) is allocated 
just after that in 
"pvh_setup_p2m" in subroutine "paging_set_allocation". 

Generally speaking from what I understood it's not the IOMMU driver that offers 
its mappings to HAP,
but it's rather the HAP that shares its mappings with IOMMU driver. So the 
obvious patch IMHO would 
be:

--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -294,8 +294,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; 

Did anyone encounter the same problem or has some thoughts on this issue?

Andrei.
1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to