From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Tiejun" Subject: Re: [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table Date: Fri, 17 Jul 2015 23:54:51 +0800 Message-ID: <55A9254B.2070900@intel.com> References: <1437093920-11472-1-git-send-email-tiejun.chen@intel.com> <1437093920-11472-8-git-send-email-tiejun.chen@intel.com> <55A8CD740200007800092545@mail.emea.novell.com> <55A8C65C.1020804@intel.com> <55A8FA26020000780009269C@mail.emea.novell.com> <55A91DAD.7030900@intel.com> <55A93BF702000078000928B0@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55A93BF702000078000928B0@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich 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 >> + for ( i = nr-1; i > memory_map.nr_map; i-- ) > > Before you add memory_map.nr_map, you should be able to iterate > from 0 to (not inclusive) nr. At least as far as I recall the original > patch. > Sorry, I really don't understand what you want. Before we add memory_map.nr_map, e820[0, nr) don't include low/high memory, right? So sounds you want me to for ( i = 0 i < memory_map.nr_map; i++ ) { if we need to adjust low memory, we just set final low e820 entry; if we need to adjust high memory, we just set final high e820 entry; } Right? But its impossible to do this since we can't assume memory_map.map[low memory] is always prior to memory_map.map[high memory]. If I still follow your way, please don't mind to show a pseudocode help me understand what you want. Thanks Tiejun