From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [Question] Why code differs in construct_dom0? Date: Thu, 20 Nov 2008 09:50:37 +0000 Message-ID: References: <61563CE63B4F854986A895DA7AD3C17701F7E61F@pdsmsx502.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <61563CE63B4F854986A895DA7AD3C17701F7E61F@pdsmsx502.ccr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Shan, Haitao" Cc: "'xen-devel@lists.xensource.com'" List-Id: xen-devel@lists.xenproject.org On 20/11/08 09:41, "Shan, Haitao" wrote: > So you mean in the release build we make the mapping discontiguous to detect > possible bugs, while in debug build it is not discontiguous? It's the other way round. > And another question from problems we encountered recently, system with more > than 4G memory installed will crash when X server shutdown. The reason is: > 1> dom0 allocates memory for agp by calling agp_allocate_memory with GFP_DMA32 > set. This implies the pfn comes from memory lower than 4G, while mfn are > likely to be from memory above 4G. > 2> dom0 then call map_pages_to_apg, since the kernel of handles 32bit gart > table, dom0 uses hypercall to change its memory mappings > (xen_create_contiguous_region). Xen will pick proper memory below 4G and free > those from the guest (likely to be from memory above 4G). > 3> As the process goes on. More and more memory below 4G is return to dom0 > while leaving memory above 4G in xen. Finally, xen's reservation of memory > below 4G for DMA are exhausted. This creates severe problems for us. > > What is your comments on this? Both increase the reservation in Xen and using > contiguous mappings are helpful in this cases. Which one do you prefer? I'd need more info on the problem. I will point out that 64-bit Xen only allocates memory below 4G when asked, or when there is no memory available above 4G. Actually 32-bit Xen is the same, except the first chunk of dom0 memory allocated has to be below 1GB (because of limitations of Xen's domain_build.c). So I'm not sure what more Xen can do? -- Keir