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

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



Hi Jan,

On 22/07/15 11:42, Jan Beulich wrote:
> 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.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx>
> Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
> ---
> v12: Restore changes as much as possible to my original version, fixing
>      a few issues that got introduced after handing it over. Unionize
>      new public memop interface structure to allow for non-PCI to be
>      supported later on. Check flags to have all currently undefined
>      flags clear. Refine adjustments to xen/pci.h.

[..]

> +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?

> +    /*
> +     * 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 */

Regards,

-- 
Julien Grall

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