Hi Rahul,

> On 28 Sep 2021, at 19:18, Rahul Singh <rahul.si...@arm.com> wrote:
> 
> ARM architecture does not implement I/O ports. Ignore this call on ARM
> to avoid the overhead of making a hypercall just for Xen to return
> -ENOSYS.
> 
> Signed-off-by: Rahul Singh <rahul.si...@arm.com>
> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org>
Reviewed-by: Bertrand Marquis <bertrand.marq...@arm.com>

Cheers
Bertrand

> ---
> Change in v3: Added Reviewed-by: Stefano Stabellini <sstabell...@kernel.org>
> Change in v2:
> - Instead of returning success in XEN, ignored the call in xl.
> ---
> tools/libs/ctrl/xc_domain.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
> 
> diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c
> index 23322b70b5..25c95f6596 100644
> --- a/tools/libs/ctrl/xc_domain.c
> +++ b/tools/libs/ctrl/xc_domain.c
> @@ -1348,6 +1348,14 @@ int xc_domain_ioport_permission(xc_interface *xch,
>                                 uint32_t nr_ports,
>                                 uint32_t allow_access)
> {
> +#if defined(__arm__) || defined(__aarch64__)
> +    /*
> +     * The ARM architecture does not implement I/O ports.
> +     * Avoid the overhead of making a hypercall just for Xen to return 
> -ENOSYS.
> +     * It is safe to ignore this call on ARM so we just return 0.
> +     */
> +    return 0;
> +#else
>     DECLARE_DOMCTL;
> 
>     domctl.cmd = XEN_DOMCTL_ioport_permission;
> @@ -1357,6 +1365,7 @@ int xc_domain_ioport_permission(xc_interface *xch,
>     domctl.u.ioport_permission.allow_access = allow_access;
> 
>     return do_domctl(xch, &domctl);
> +#endif
> }
> 
> int xc_availheap(xc_interface *xch,
> -- 
> 2.17.1
> 


Reply via email to