From: "Jan Beulich" Subject: Re: [PATCH v3 3/8] hvmloader: Set up highmem resouce appropriately if there is no RAM above 4G Date: Fri, 21 Jun 2013 08:01:24 +0100 Message-ID: <51C4166402000078000DF811@nat28.tlf.novell.com> References: <1371746007-19073-1-git-send-email-george.dunlap@eu.citrix.com> <1371746007-19073-4-git-send-email-george.dunlap@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1371746007-19073-4-git-send-email-george.dunlap@eu.citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Keir Fraser , Ian Campbell , Hanweidong , xen-devel@lists.xen.org, StefanoStabellini , Ian Jackson List-Id: xen-devel@lists.xenproject.org >>> On 20.06.13 at 18:33, George Dunlap wrote: > @@ -244,7 +244,14 @@ void pci_setup(void) > hvm_info->high_mem_pgend += nr_pages; > } > > - high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT; > > + if ( hvm_info->high_mem_pgend ) To be on the safe side I'd make this if ( hvm_info->high_mem_pgend >= (1ull << 32) ) > + high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT; > + else > + high_mem_resource.base = 1ull << 32; > + printf("%sRAM in high memory; setting high_mem resource base to %x%08x\n", > + hvm_info->high_mem_pgend?"":"No ", > + (uint32_t)(high_mem_resource.base>>32), > + (uint32_t)high_mem_resource.base); Seeing the n-th incarnation of this - mind creating a macro to do the splitting? Jan > high_mem_resource.max = 1ull << cpu_phys_addr(); > mem_resource.base = pci_mem_start; > mem_resource.max = pci_mem_end;