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

Re: [Xen-devel] [PATCH v12] introduce XENMEM_reserved_device_memory_map



>>> On 22.07.15 at 14:17, <julien.grall@xxxxxxxxxx> wrote:
> On 22/07/15 11:42, Jan Beulich wrote:
> 
>> +struct xen_reserved_device_memory_map {
>> +#define XENMEM_RDM_ALL 1 /* Request all regions (ignore dev union). */
>> +    /* IN */
>> +    uint32_t flags;
>> +    union {
>> +        struct physdev_pci_device pci;
>> +    } dev;
> 
> The size of physdev_pci_device is 4 bytes. So the maximum size of the
> union would be 4 bytes as we can't change the layout of the hypercall
> (IIRC, memory hypercall should be stable).
> 
> Let's say we want to add support for device describe in the device tree.
> The only way to find a device is a path, so it means that we at least
> need a size field and a XEN_GUEST_HANDLE for the path.
> 
> That won't fit in the union and we won't even be able to specify a
> XEN_GUEST_HANDLE to point to another structure.
> 
> Would it be possible to either make sure that the union is at least the
> size of a XEN_GUEST_HANDLE and/or move the union at the end of the
> structure?

Very good point! Yes, I'll move it to the end. Whether to also add
a dummy handle right away I'm not sure. While not doing so now
will require a bit more care when extending the structure, it keeps
the interface uncluttered (and we don't really know at this point
whether we'd want a handle or a bigger union member or both or
yet something else).

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®.