From: "Jan Beulich" Subject: Re: [v10][PATCH 07/16] hvmloader/e820: construct guest e820 table Date: Mon, 20 Jul 2015 12:56:09 +0100 Message-ID: <55ACFDF902000078000930C9@mail.emea.novell.com> References: <1437373023-14884-1-git-send-email-tiejun.chen@intel.com> <1437373023-14884-8-git-send-email-tiejun.chen@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1437373023-14884-8-git-send-email-tiejun.chen@intel.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: Tiejun Chen Cc: Wei Liu , Ian Campbell , Stefano Stabellini , Andrew Cooper , Ian Jackson , xen-devel@lists.xen.org, Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 20.07.15 at 08:16, wrote: > + /* If there was no highmem region, just create one. */ > + if ( i == memory_map.nr_map ) > + { > + memory_map.map[i].addr = ((uint64_t)1 << 32); > + memory_map.map[i].size = add_high_mem; > + memory_map.map[i].type = E820_RAM; Don't you need to increment memory_map.nr_map here? > + } > + > + /* A sanity check if high memory is broken. */ > + BUG_ON( high_mem_end != > + memory_map.map[i].addr + memory_map.map[i].size); > + } > + > + /* Now fulfill e820. */ s/fulfill/fill/. > + /* Finally we need to sort all e820 entries. */ > + for ( j = 0; j < nr-1; j++ ) > + { > + for ( i = j+1; i < nr; i++ ) Blanks around binary operators please. Jan