Hi Stefano, > -----Original Message----- > From: Stefano Stabellini <sstabell...@kernel.org> > > > But also it looks like that on arm32 we have specific requirements for > > > Xen heap: > > > > > > * - must be 32 MiB aligned > > > * - must not include Xen itself or the boot modules > > > * - must be at most 1GB or 1/32 the total RAM in the system if less > > > * - must be at least 32M > > > > ...here, with the "1/32 the total RAM" now being "1/32 of the total reserved > > heap region", since heap_pages is now reserved_heap_pages. > > I see. I didn't realize the full implications of the memory being used > for both xenheap and domheap on arm32. In that case, I would simply do > the following: > > > heap_pages = !reserved_heap ? ram_pages : reserved_heap_pages; > > if ( opt_xenheap_megabytes ) > xenheap_pages = opt_xenheap_megabytes << (20-PAGE_SHIFT); > else > { > xenheap_pages = (heap_pages/32 + 0x1fffUL) & ~0x1fffUL; > xenheap_pages = max(xenheap_pages, 32UL<<(20-PAGE_SHIFT)); > xenheap_pages = min(xenheap_pages, 1UL<<(30-PAGE_SHIFT)); > } > > if ( reserved_heap ) > e = reserved_heap_end; > else > { > do > { > e = consider_modules(ram_start, ram_end, > pfn_to_paddr(xenheap_pages), > 32<<20, 0); > > if ( e ) > break; > > xenheap_pages >>= 1; > } while ( !opt_xenheap_megabytes && xenheap_pages > 32<<(20- > PAGE_SHIFT) ); > } > > if ( ! e || > ( reserved_heap && reserved_heap_pages < 32<<(20-PAGE_SHIFT) ) ) > panic("Not enough space for xenheap\n"); > > domheap_pages = heap_pages - xenheap_pages;
Thanks very much for your time and patience. I will follow this way - with the comment also updated of course (I didn't realize the comment needs to be changed until yesterday when I sent the reply to your last comment.) Kind regards, Henry