From: "Jan Beulich" Subject: Re: [v8][PATCH 09/17] hvmloader/ram: check if guest memory is out of reserved device memory maps Date: Fri, 05 Dec 2014 07:43:46 +0000 Message-ID: <54817042020000780004D012@mail.emea.novell.com> References: <1417425875-9634-1-git-send-email-tiejun.chen@intel.com> <1417425875-9634-10-git-send-email-tiejun.chen@intel.com> <548097C5020000780004CD72@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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: Kevin Tian , Tiejun Chen Cc: "wei.liu2@citrix.com" , "ian.campbell@citrix.com" , "stefano.stabellini@eu.citrix.com" , "tim@xen.org" , "ian.jackson@eu.citrix.com" , "xen-devel@lists.xen.org" , Yang Z Zhang List-Id: xen-devel@lists.xenproject.org >>> On 05.12.14 at 07:23, wrote: >> From: Jan Beulich [mailto:JBeulich@suse.com] >> Sent: Friday, December 05, 2014 12:20 AM >> >> >>> On 01.12.14 at 10:24, wrote: >> > We need to check to reserve all reserved device memory maps in e820 >> > to avoid any potential guest memory conflict. >> > >> > Currently, if we can't insert RDM entries directly, we may need to handle >> > several ranges as follows: >> > a. Fixed Ranges --> BUG() >> > lowmem_reserved_base-0xA0000: reserved by BIOS implementation, >> > BIOS region, >> > RESERVED_MEMBASE ~ 0x100000000, >> > b. RAM or RAM:Hole -> Try to reserve >> >> I continue to be unconvinced of the overall approach: The domain >> builder continues to populate these regions when it shouldn't. Yet >> once it doesn't, it would be most natural to simply communicate the > > doesn't -> does? No. The domain builder currently populates these regions (at least I didn't spot a change to make it not do so). >> RAM regions to hvmloader, and hvmloader would use just that to >> build the E820 table (and subsequently assign BARs). >> > > My impression is that you didn't like extending hvm_info to carry > sparse RAM regions. that's why the current tradeoff is taken, i.e. > leaving domain builder unchanged for RAM, then preventing EPT > setup for reserved regions in hypervisor (means wasting memory), > and then having hvmloader to actually figure out the final e820. > and that's also why per-BDF design is introduced to minimize wasted > memory. We discussed to change domain builder to avoid populating > reserved regions as the next step after 4.5, but w/o extending > hvm_info we always need the logic in hvmloader to construct e820 > from scratch. Communicating this via hvm_info is not the only way. For example, the XENMEM_{set_,}memory_map pair of hypercalls could be used (and is readily available to be extended that way, since for HVM domains XENMEM_set_memory_map returns -EPERM at present). The only potentially problematic aspect I can see with using it might be its limiting of the entry count to E820MAX. Jan