From: Wei Liu Subject: Re: [v5][PATCH 11/16] tools/libxl: detect and avoid conflicts with RDM Date: Tue, 7 Jul 2015 12:20:56 +0100 Message-ID: <20150707112056.GR1134@zion.uk.xensource.com> References: <1436249837-14747-1-git-send-email-tiejun.chen@intel.com> <1436249837-14747-12-git-send-email-tiejun.chen@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1436249837-14747-12-git-send-email-tiejun.chen@intel.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: Tiejun Chen Cc: Wei Liu , Stefano Stabellini , Ian Jackson , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, Jul 07, 2015 at 02:17:12PM +0800, Tiejun Chen wrote: > While building a VM, HVM domain builder provides struct hvm_info_table{} > to help hvmloader. Currently it includes two fields to construct guest > e820 table by hvmloader, low_mem_pgend and high_mem_pgend. So we should > check them to fix any conflict with RDM. > > RMRR can reside in address space beyond 4G theoretically, but we never > see this in real world. So in order to avoid breaking highmem layout > we don't solve highmem conflict. Note this means highmem rmrr could still > be supported if no conflict. > > But in the case of lowmem, RMRR probably scatter the whole RAM space. > Especially multiple RMRR entries would worsen this to lead a complicated > memory layout. And then its hard to extend hvm_info_table{} to work > hvmloader out. So here we're trying to figure out a simple solution to > avoid breaking existing layout. So when a conflict occurs, > > #1. Above a predefined boundary (2G) > - move lowmem_end below reserved region to solve conflict; > > #2. Below a predefined boundary (2G) > - Check strict/relaxed policy. > "strict" policy leads to fail libxl. Note when both policies > are specified on a given region, 'strict' is always preferred. > "relaxed" policy issue a warning message and also mask this entry INVALID > to indicate we shouldn't expose this entry to hvmloader. > > Note later we need to provide a parameter to set that predefined boundary > dynamically. > > CC: Ian Jackson > CC: Stefano Stabellini > CC: Ian Campbell > CC: Wei Liu > Signed-off-by: Tiejun Chen > Reviewed-by: Kevin Tian > --- > v5: > > * A little change to make sure the per-device policy always override the global > policy and correct its associated code comments. > * Fix one typo in the patch head description > * Rename xc_device_get_rdm() with libxl__xc_device_get_rdm(), and then replace > malloc() with libxl__malloc(), and finally cleanup this fallout. > * libxl__xc_device_get_rdm() should return proper libxl error code, ERROR_FAIL. > Then instead, the allocated RDM entries would be returned with an out parameter. > This patch does what we've discussed so Acked-by: Wei Liu