Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-19 Thread Chen, Tiejun
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? Why? memory_map is

Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-18 Thread George Dunlap
On Fri, Jul 17, 2015 at 5:06 PM, Jan Beulich wrote: On 17.07.15 at 17:54, wrote: >>> > +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 >>> patc

Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-17 Thread Chen, Tiejun
On 2015/7/18 0:06, Jan Beulich wrote: On 17.07.15 at 17:54, wrote: +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 understa

Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-17 Thread Jan Beulich
>>> On 17.07.15 at 17:54, wrote: >> > +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.

Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-17 Thread Chen, Tiejun
+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 i

Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-17 Thread Jan Beulich
>>> On 17.07.15 at 17:22, wrote: > Do you mean I should check low/high mem before we add the hypervisor > supplied entries Yes. > like this? Not exactly: > +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 inclusi

Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-17 Thread Chen, Tiejun
On 2015/7/17 18:50, Jan Beulich wrote: On 17.07.15 at 11:09, wrote: And then of course there's the question of whether "nr" is really the right upper loop bound here: Just prior to this you added the hypervisor supplied entries - why would you need to iterate over them here? I.e. I'd see this b

Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-17 Thread Jan Beulich
>>> On 17.07.15 at 11:27, wrote: >> Remind me again please - what prevents the highmem region from >> colliding with hypervisor supplied entries? >> >> Also, what if the resulting region exceeds the addressable range >> (guest's view of CPUID[8008].EAX[0:7])? > > Any idea to this? I think th

Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-17 Thread Jan Beulich
>>> On 17.07.15 at 11:09, wrote: >> And then of course there's the question of whether "nr" is really >> the right upper loop bound here: Just prior to this you added >> the hypervisor supplied entries - why would you need to iterate >> over them here? I.e. I'd see this better be moved ahead of th

Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-17 Thread Chen, Tiejun
Remind me again please - what prevents the highmem region from colliding with hypervisor supplied entries? Also, what if the resulting region exceeds the addressable range (guest's view of CPUID[8008].EAX[0:7])? Any idea to this? I think this issue also exists previously. Thanks Tiejun __

Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-17 Thread Chen, Tiejun
The way it's written I take it that you assume there to be exactly one region that the adjustment needs to be done for. Iirc this is correct with the current model, but why would you continue the loop then afterwards? Placing a "break" in the if()'s body would document the fact that only one such

Re: [Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-17 Thread Jan Beulich
>>> On 17.07.15 at 02:45, wrote: > Now use the hypervisor-supplied memory map to build our final e820 table: > * Add regions for BIOS ranges and other special mappings not in the > hypervisor map > * Add in the hypervisor regions ... hypervisor supplied regions? > --- a/tools/firmware/hvmloade

[Xen-devel] [v9][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-16 Thread Tiejun Chen
Now use the hypervisor-supplied memory map to build our final e820 table: * Add regions for BIOS ranges and other special mappings not in the hypervisor map * Add in the hypervisor regions * Adjust the lowmem and highmem regions if we've had to relocate memory (adding a highmem region if necess