From: Wei Liu Subject: Re: [v4][PATCH 14/19] tools/libxl: detect and avoid conflicts with RDM Date: Fri, 26 Jun 2015 13:13:49 +0100 Message-ID: <20150626121349.GC1609@zion.uk.xensource.com> References: <1435053450-25131-1-git-send-email-tiejun.chen@intel.com> <1435053450-25131-15-git-send-email-tiejun.chen@intel.com> <20150625112352.GJ6545@zion.uk.xensource.com> <558CE6DE.8010204@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: <558CE6DE.8010204@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: "Chen, Tiejun" Cc: Ian Jackson , Stefano Stabellini , Wei Liu , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, Jun 26, 2015 at 01:45:02PM +0800, Chen, Tiejun wrote: > On 2015/6/25 19:23, Wei Liu wrote: > >On Tue, Jun 23, 2015 at 05:57:25PM +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 RAM. > >> > > > >RAM -> RDM? > > Fixed. > > > > >>RMRR can reside in address space beyond 4G theoretically, but we never > > [snip] > > >>+static struct xen_reserved_device_memory > >>+*xc_device_get_rdm(libxl__gc *gc, > >>+ uint32_t flag, > >>+ uint16_t seg, > >>+ uint8_t bus, > >>+ uint8_t devfn, > >>+ unsigned int *nr_entries) > > > >I just notice this function lives in libxl_dm.c. The function should be > >renamed to libxl__xc_device_get_rdm. > > > >This function should return proper libxl error code (ERROR_FAIL or > >something more appropriate). The allocated RDM entries should be > > ERROR_FAIL is better. > > So refactor this function after address your all comments, > > static int > libxl__xc_device_get_rdm(libxl__gc *gc, > uint32_t flag, > uint16_t seg, > uint8_t bus, > uint8_t devfn, > unsigned int *nr_entries, > struct xen_reserved_device_memory *xrdm) Shouldn't this be struct xen_reserved_device_memory **xrdm? That is, pointer to a pointer. The code structure looks OK. Wei.