On 26.06.2023 05:34, Penny Zheng wrote:
> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -54,6 +54,9 @@ config HAS_IOPORTS
>  config HAS_KEXEC
>       bool
>  
> +config HAS_PAGING_MEMPOOL
> +     bool
> +
>  config HAS_PDX
>       bool
>  
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -844,6 +844,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>          ret = iommu_do_domctl(op, d, u_domctl);
>          break;
>  
> +#ifdef CONFIG_HAS_PAGING_MEMPOOL
>      case XEN_DOMCTL_get_paging_mempool_size:
>          ret = arch_get_paging_mempool_size(d, &op->u.paging_mempool.size);
>          if ( !ret )
> @@ -857,6 +858,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>              ret = hypercall_create_continuation(
>                  __HYPERVISOR_domctl, "h", u_domctl);
>          break;
> +#endif

While I'm not outright opposed to doing it this way, I wonder
whether it wouldn't be better to leave common code untouched by
making arch_get_paging_mempool_size() do what you want done.
That's part of what arch hooks are for, after all.

Jan

Reply via email to