[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [v5][PATCH 01/16] xen: introduce XENMEM_reserved_device_memory_map



>>> On 07.07.15 at 23:32, <tiejun.chen@xxxxxxxxx> wrote:
>>>>>> +    /* 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.
>>>>
>>>> I think this is in line with everything else in this header - am I
>>>> overlooking something?
>>>
>>> In particular, wouldn't it be sensible to write down that if the
>>> number of entries available is bigger than nr_entries, the hypercall
>>> fails with ERANGE, sets nr_entries to the real number of entries, and
>>> leaves the buffer in an undefined state ?
>>
>> I can add a sentence to that effect.
> 
> Please deliver your final patch to me and then I can resend that next.

Here's the respective updated hunk:

--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -573,7 +573,34 @@ struct xen_vnuma_topology_info {
 typedef struct xen_vnuma_topology_info xen_vnuma_topology_info_t;
 DEFINE_XEN_GUEST_HANDLE(xen_vnuma_topology_info_t);
 
-/* Next available subop number is 27 */
+/*
+ * 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.
+ */
+#define XENMEM_reserved_device_memory_map   27
+struct xen_reserved_device_memory {
+    xen_pfn_t start_pfn;
+    xen_ulong_t nr_pages;
+};
+typedef struct xen_reserved_device_memory xen_reserved_device_memory_t;
+DEFINE_XEN_GUEST_HANDLE(xen_reserved_device_memory_t);
+
+struct xen_reserved_device_memory_map {
+    /*
+     * IN/OUT
+     *
+     * Gets set to the required number of entries when too low,
+     * signaled by error code -ERANGE. */
+     */
+    unsigned int nr_entries;
+    /* OUT */
+    XEN_GUEST_HANDLE(xen_reserved_device_memory_t) buffer;
+};
+typedef struct xen_reserved_device_memory_map xen_reserved_device_memory_map_t;
+DEFINE_XEN_GUEST_HANDLE(xen_reserved_device_memory_map_t);
+
+/* Next available subop number is 28 */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
 
Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.