[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 27/06/17 14:43, Bhupinder Thakur wrote:
Hi Julien,

Hi Bhupinder,


+#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.



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

Currently, xc_dom_vpl011_init() is called only if info->arch_arm.vuart
flag is true. This check may look a bit odd in the
common code.

I am not asking to call xc_dom_vpl011_init from common code. I am only asking to make this function available for anyone.

Cheers,

--
Julien Grall

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