From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [PATCH 17/18 V2]: PVH xen: PVH dom0 creation... Date: Thu, 28 Mar 2013 17:32:05 -0700 Message-ID: <20130328173205.49fe631d@mantra.us.oracle.com> References: <20130315180645.59f8618e@mantra.us.oracle.com> <51471E3302000078000C65FD@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51471E3302000078000C65FD@nat28.tlf.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: xen-devel List-Id: xen-devel@lists.xenproject.org On Mon, 18 Mar 2013 13:01:23 +0000 "Jan Beulich" wrote: > >>> On 16.03.13 at 02:06, Mukesh Rathor > >>> wrote: > > @@ -307,6 +309,65 @@ static void __init > > process_dom0_ioports_disable(void) } > > } > > > > +/* > > + * Set the 1:1 map for all non-RAM regions for dom 0. Thus, dom0 > > will have > > + * the entire io region mapped in the EPT/NPT. > > + */ > > +static __init void pvh_map_all_iomem(struct domain *d) > > +{ > > + unsigned long start = 0; > > + const struct e820entry *entry; > > + int rc, i, nump; > > + > > + for (i = 0, entry = e820.map; i < e820.nr_map; i++, entry++) { > > + unsigned long end = entry->addr + entry->size; > > + > > + if (entry->type == E820_RAM || i == e820.nr_map - 1) { > > + unsigned long start_pfn = PFN_DOWN(start); > > + unsigned long end_pfn = PFN_UP(end); > > + > > + if (entry->type == E820_RAM) > > + end_pfn = PFN_UP(entry->addr); > > + > > + if (start_pfn < end_pfn) { > > + nump = end_pfn - start_pfn + 1; > > + rc = domctl_memory_mapping(d, start_pfn, > > start_pfn, nump, 1); > > + BUG_ON(rc); > > + } > > + start = end; > > + } > > + } > > At least E820_UNUSABLE must be excluded here. > > And as you're mapping the holes only - how do you deal with > the MMIO range past end of RAM? And perhaps even more > important - how do you deal with the split between RAM and > MMIO not being at the end of currently populated RAM, but > at the end of possible hotpluggable regions. Right now, phase I, no support for hotplug. Are there any other cases of this, can you please give an example if yes?