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

Re: [Xen-devel] [PATCH 08/17 v5] xen/arm: vpl011: Add a new domctl API to initialize vpl011



On Fri, 23 Jun 2017, Julien Grall wrote:
> On 23/06/17 14:17, Julien Grall wrote:
> > 
> > 
> > On 23/06/17 00:04, Stefano Stabellini wrote:
> > > > diff --git a/tools/libxc/include/xenctrl.h
> > > > b/tools/libxc/include/xenctrl.h
> > > > index 1629f41..26f3d1e 100644
> > > > --- a/tools/libxc/include/xenctrl.h
> > > > +++ b/tools/libxc/include/xenctrl.h
> > > > @@ -885,6 +885,26 @@ int xc_vcpu_getcontext(xc_interface *xch,
> > > >                         uint32_t vcpu,
> > > >                         vcpu_guest_context_any_t *ctxt);
> > > > 
> > > > +#if defined (__arm__) || defined(__aarch64__)
> > > > +/**
> > > > + * This function initializes the vpl011 emulation and returns
> > > > + * the event to be used by the backend for communicating with
> > > > + * the emulation code.
> > > > + *
> > > > + * @parm xch a handle to an open hypervisor interface
> > > > + * @parm domid the domain to get information from
> > > > + * @parm console_domid the domid of the backend console
> > > > + * @parm gfn the guest pfn to be used as the ring buffer
> > > > + * @parm evtchn the event channel to be used for events
> > > > + * @return 0 on success, negative error on failure
> > > > + */
> > > > +int xc_dom_vpl011_init(xc_interface *xch,
> > > > +                       uint32_t domid,
> > > > +                       uint32_t console_domid,
> > > > +                       xen_pfn_t gfn,
> > > > +                       evtchn_port_t *evtchn);
> > > > +#endif
> > > 
> > > Actually, the pattern is to define the xc_ function on all architecture
> > > but only return ENOSYS where it's not implemented, see
> > > xc_vcpu_get_extstate.
> > 
> > Well, I think the main reason behind if to avoid dummy call to the
> > hypervisor. But effectively the hypervisor will return a proper error.
> 
> Actually, looking at the public header. This is because vcpu_get_extstate
> structure is only available on x86. Whereas vpl011_init is available for all
> the architecture even though only ARM effectively implementing it.
> 
> But my point stands below, there is no harm to implement it for x86 as it
> would compile on any platform.

Sounds good to me


> > 
> > As the call is not made in common code, I would make this function
> > compile on all the platform (there are nothing arch specific in it).
 

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