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

Re: [Xen-devel] [PATCH 3/5] xen: create wrappers for all other uses of xc_hvm_XXX() functions



On Thu, Feb 23, 2017 at 02:53:53PM +0000, Paul Durrant wrote:
> This patch creates inline wrapper functions in xen_common.h for all open
> coded calls to xc_hvm_XXX() functions outside of xen_common.h so that use
> of xen_xc can be made implicit. This again is in preparation for the move
> to using libxendevicemodel.
> 
> Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
> ---
> diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
> index 1e08b98..31cf25f 100644
> --- a/include/hw/xen/xen_common.h
> +++ b/include/hw/xen/xen_common.h
> @@ -26,6 +26,50 @@ extern xc_interface *xen_xc;
>   * We don't support Xen prior to 4.2.0.
>   */
>  
> +static inline int xen_set_mem_type(domid_t domid, hvmmem_type_t type,
> +                                   uint64_t first_pfn, uint32_t nr)
> +{

I don't know if it matters from where the functions are called, but
here, xc_hvm_set_mem_type takes a "uint64_t nr" (and not uint32_t).

> +    return xc_hvm_set_mem_type(xen_xc, domid, type, first_pfn, nr);
> +}
> +
> +static inline int xen_set_pci_intx_level(domid_t domid, uint16_t segment,
> +                                         uint8_t bus, uint8_t device,
> +                                         uint8_t intx, unsigned int level)
> +{
> +    return xc_hvm_set_pci_intx_level(xen_xc, domid, segment, bus, device,
> +                                     intx, level);
> +}
> +
> +static inline int xen_set_pci_link_route(domid_t domid, uint8_t link,
> +                                         uint8_t irq)
> +{
> +    return xc_hvm_set_pci_link_route(xen_xc, domid, link, irq);
> +}
> +
> +static inline int xen_inject_msi(domid_t domid, uint64_t msi_addr,
> +                                 uint32_t msi_data)
> +{
> +    return xc_hvm_inject_msi(xen_xc, domid, msi_addr, msi_data);
> +}
> +
> +static inline int xen_set_isa_irq_level(domid_t domid, uint8_t irq,
> +                                        unsigned int level)
> +{
> +    return xc_hvm_set_isa_irq_level(xen_xc, domid, irq, level);
> +}
> +
> +static inline int xen_track_dirty_vram(domid_t domid, uint64_t first_pfn,
> +                                       uint32_t nr, unsigned long *bitmap)
> +{

Same here.

> +    return xc_hvm_track_dirty_vram(xen_xc, domid, first_pfn, nr, bitmap);
> +}
> +
> +static inline int xen_modified_memory(domid_t domid, uint64_t first_pfn,
> +                                      uint32_t nr)
> +{

And here.

> +    return xc_hvm_modified_memory(xen_xc, domid, first_pfn, nr);
> +}
> +
>  /* Xen 4.2 through 4.6 */
>  #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 471
>  

The rest looks good.

-- 
Anthony PERARD

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

 


Rackspace

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