From: Ian Jackson Subject: Re: [v5][PATCH 01/16] xen: introduce XENMEM_reserved_device_memory_map Date: Tue, 7 Jul 2015 12:17:41 +0100 Message-ID: <21915.46421.168214.462484@mariner.uk.xensource.com> References: <1436249837-14747-1-git-send-email-tiejun.chen@intel.com> <1436249837-14747-2-git-send-email-tiejun.chen@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1436249837-14747-2-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: Yang Zhang , Kevin Tian , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Tiejun Chen writes ("[Xen-devel] [v5][PATCH 01/16] xen: introduce XENMEM_reserved_device_memory_map"): > From: Jan Beulich > > This is a prerequisite for punching holes into HVM and PVH guests' P2M > to allow passing through devices that are associated with (on VT-d) > RMRRs. ... This function: > +++ b/xen/common/compat/memory.c ... > +static int get_reserved_device_memory(xen_pfn_t start, xen_ulong_t nr, > + u32 id, void *ctxt) is remarkably similar to this function > +++ b/xen/common/memory.c ... > +static int get_reserved_device_memory(xen_pfn_t start, xen_ulong_t nr, > + u32 id, void *ctxt) Is this usual in hypervisor code ? It may be that this is the general approach in compat code and that any cure would be worse than the disease, but I found it very striking. > +/* > + * With some legacy devices, certain guest-physical addresses cannot safely > + * be used for other purposes, e.g. to map guest RAM. This hypercall > + * enumerates those regions so the toolstack can avoid using them. ... > + /* IN/OUT */ > + unsigned int nr_entries; Perhaps I am missing something but I can't find any API documentation for the return value and error returns from this new hypercall. Thanks, Ian.