Skip to contentSkip to conversation

xen: move getdomaininfo() to domain.c

PATCH In review Penny Zheng 3 participants 10 messages Jul 22, 2025 – Jul 25, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: move getdomaininfo() to domain.c

Function getdomaininfo() is not only invoked by domctl-op, but also sysctl-op, so it shall better live in domain.c, rather than domctl.c. Which is also applied for arch_get_domain_info(). Style corrections shall be applied at the same time while moving these functions, such as converting u64 to uint64_t.

The movement could also fix CI error of a randconfig picking both SYSCTL=y and PV_SHIM_EXCLUSIVE=y results in sysctl.c being built, but domctl.c not being built, which leaves getdomaininfo() undefined, causing linking to fail.

Fixes 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")
---
 xen/arch/arm/domain.c |  9 ++++++
 xen/arch/arm/domctl.c |  9 ------
 xen/arch/x86/domain.c | 10 +++++++
 xen/arch/x86/domctl.c | 10 -------
 xen/common/domain.c   | 64 +++++++++++++++++++++++++++++++++++++++++++
 xen/common/domctl.c   | 64 -------------------------------------------
 6 files changed, 83 insertions(+), 83 deletions(-)
xen/arch/arm/domain.c +9 -0
index 79a144e61b..2c2ef639ee 100644
@@ -1206,6 +1206,15 @@ void vcpu_kick(struct vcpu *v)
     }
 }
 
+void arch_get_domain_info(const struct domain *d,
+                          struct xen_domctl_getdomaininfo *info)
+{
+    /* All ARM domains use hardware assisted paging. */
+    info->flags |= XEN_DOMINF_hap;
+
+    info->gpaddr_bits = p2m_ipa_bits;
+}
+
 /*
  * Local variables:
  * mode: C
xen/arch/arm/domctl.c +0 -9
index ad914c915f..e0ea73005a 100644
@@ -17,15 +17,6 @@
 #include <xsm/xsm.h>
 #include <public/domctl.h>
 
-void arch_get_domain_info(const struct domain *d,
-                          struct xen_domctl_getdomaininfo *info)
-{
-    /* All ARM domains use hardware assisted paging. */
-    info->flags |= XEN_DOMINF_hap;
-
-    info->gpaddr_bits = p2m_ipa_bits;
-}
-
 static int handle_vuart_init(struct domain *d, 
                              struct xen_domctl_vuart_op *vuart_op)
 {
xen/arch/x86/domain.c +10 -0
index 56c3816187..4af9f41cca 100644
@@ -2639,6 +2639,16 @@ unsigned int domain_max_paddr_bits(const struct domain *d)
     return bits;
 }
 
+void arch_get_domain_info(const struct domain *d,
+                          struct xen_domctl_getdomaininfo *info)
+{
+    if ( paging_mode_hap(d) )
+        info->flags |= XEN_DOMINF_hap;
+
+    info->arch_config.emulation_flags = d->arch.emulation_flags;
+    info->gpaddr_bits = hap_paddr_bits;
+}
+
 /*
  * Local variables:
  * mode: C
xen/arch/x86/domctl.c +0 -10
index 3044f706de..35572767ba 100644
@@ -138,16 +138,6 @@ static int vcpu_set_vmce(struct vcpu *v,
     return vmce_restore_vcpu(v, &vmce);
 }
 
-void arch_get_domain_info(const struct domain *d,
-                          struct xen_domctl_getdomaininfo *info)
-{
-    if ( paging_mode_hap(d) )
-        info->flags |= XEN_DOMINF_hap;
-
-    info->arch_config.emulation_flags = d->arch.emulation_flags;
-    info->gpaddr_bits = hap_paddr_bits;
-}
-
 static int do_vmtrace_op(struct domain *d, struct xen_domctl_vmtrace_op *op,
                          XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
xen/common/domain.c +64 -0

70 lines not on this page · raw message

xen/common/domctl.c +0 -64

70 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw
Quoted 6 lines · Penny Zheng

Function getdomaininfo() is not only invoked by domctl-op, but also sysctl-op, so it shall better live in domain.c, rather than domctl.c. Which is also applied for arch_get_domain_info(). Style corrections shall be applied at the same time while moving these functions, such as converting u64 to uint64_t.

Quoted 7 lines

The movement could also fix CI error of a randconfig picking both SYSCTL=y and PV_SHIM_EXCLUSIVE=y results in sysctl.c being built, but domctl.c not being built, which leaves getdomaininfo() undefined, causing linking to fail.

Fixes 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")

I'm not convinced of this approach. In the longer run this would mean wrapping everything you move in "#if defined(CONFIG_SYSCTL) || defined(CONFIG_DOMCTL)", which I consider undesirable. Without DOMCTL, the usefulness of XEN_SYSCTL_getdomaininfolist is at least questionable. Therefore adding more isolated "#ifdef CONFIG_DOMCTL" just there may be an option. Similarly, as mentioned on the other thread, having SYSCTL depend on DOMCTL is an approach which imo wants at least considering. And there surely are further options.

As indicated elsewhere, my preference goes towards reverting the final one or two patches of that series. They can be re-applied once the dependencies were properly sorted, which may (as per above) involve properly introducing a DOMCTL Kconfig setting first.

Jan

Reviewed-by
#2 lore raw
Quoted 23 lines · Jan Beulich
Quoted 6 lines · Penny Zheng

Function getdomaininfo() is not only invoked by domctl-op, but also sysctl-op, so it shall better live in domain.c, rather than domctl.c. Which is also applied for arch_get_domain_info(). Style corrections shall be applied at the same time while moving these functions, such as converting u64 to uint64_t.

Quoted 7 lines

The movement could also fix CI error of a randconfig picking both SYSCTL=y and PV_SHIM_EXCLUSIVE=y results in sysctl.c being built, but domctl.c not being built, which leaves getdomaininfo() undefined, causing linking to fail.

Fixes 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")

I'm not convinced of this approach. In the longer run this would mean wrapping everything you move in "#if defined(CONFIG_SYSCTL) || defined(CONFIG_DOMCTL)", which I consider undesirable. Without DOMCTL, the usefulness of XEN_SYSCTL_getdomaininfolist is at least questionable. Therefore adding more isolated "#ifdef CONFIG_DOMCTL" just there may be an option. Similarly, as mentioned on the other thread, having SYSCTL depend on DOMCTL is an approach which imo wants at least considering. And there surely are further options.

Quoted 4 lines

As indicated elsewhere, my preference goes towards reverting the final one or two patches of that series. They can be re-applied once the dependencies were properly sorted, which may (as per above) involve properly introducing a DOMCTL Kconfig setting first.

I don't think this is a good idea. The patch that Penny wrote addresses this specific issue effectively and allows us to move forward. It also helps us continue identifying problems in GitLab CI and prevents regressions with CONFIG_SYSCTL.

I am also aware that Penny has already more patches to send, including the DOMCTL Kconfig you are asking.

I think this patch is fine as is:

#3 lore raw
Quoted 24 lines · Stefano Stabellini
Quoted 23 lines · Jan Beulich
Quoted 6 lines · Penny Zheng

Function getdomaininfo() is not only invoked by domctl-op, but also sysctl-op, so it shall better live in domain.c, rather than domctl.c. Which is also applied for arch_get_domain_info(). Style corrections shall be applied at the same time while moving these functions, such as converting u64 to uint64_t.

Quoted 7 lines

The movement could also fix CI error of a randconfig picking both SYSCTL=y and PV_SHIM_EXCLUSIVE=y results in sysctl.c being built, but domctl.c not being built, which leaves getdomaininfo() undefined, causing linking to fail.

Fixes 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")

I'm not convinced of this approach. In the longer run this would mean wrapping everything you move in "#if defined(CONFIG_SYSCTL) || defined(CONFIG_DOMCTL)", which I consider undesirable. Without DOMCTL, the usefulness of XEN_SYSCTL_getdomaininfolist is at least questionable. Therefore adding more isolated "#ifdef CONFIG_DOMCTL" just there may be an option. Similarly, as mentioned on the other thread, having SYSCTL depend on DOMCTL is an approach which imo wants at least considering. And there surely are further options.

Quoted 6 lines
Quoted 4 lines

As indicated elsewhere, my preference goes towards reverting the final one or two patches of that series. They can be re-applied once the dependencies were properly sorted, which may (as per above) involve properly introducing a DOMCTL Kconfig setting first.

I don't think this is a good idea.

And implicitly you say that what I put under question in the first paragraph is a good way forward?

Jan

Quoted 11 lines

The patch that Penny wrote addresses
this specific issue effectively and allows us to move forward. It also helps us continue identifying problems in GitLab CI and prevents regressions with CONFIG_SYSCTL.

I am also aware that Penny has already more patches to send, including the DOMCTL Kconfig you are asking.

I think this patch is fine as is:

#4 lore raw
Quoted 30 lines · Jan Beulich
Quoted 29 lines · Stefano Stabellini
Quoted 27 lines · Jan Beulich
Quoted 6 lines · Penny Zheng

Function getdomaininfo() is not only invoked by domctl-op, but also sysctl-op, so it shall better live in domain.c, rather than domctl.c. Which is also applied for arch_get_domain_info(). Style corrections shall be applied at the same time while moving these functions, such as converting u64 to uint64_t.

Quoted 7 lines

The movement could also fix CI error of a randconfig picking both SYSCTL=y and PV_SHIM_EXCLUSIVE=y results in sysctl.c being built, but domctl.c not being built, which leaves getdomaininfo() undefined, causing linking to fail.

Fixes 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")

I'm not convinced of this approach. In the longer run this would mean wrapping everything you move in "#if defined(CONFIG_SYSCTL) || defined(CONFIG_DOMCTL)", which I consider undesirable. Without DOMCTL, the usefulness of XEN_SYSCTL_getdomaininfolist is at least questionable. Therefore adding more isolated "#ifdef CONFIG_DOMCTL" just there may be an option. Similarly, as mentioned on the other thread, having SYSCTL depend on DOMCTL is an approach which imo wants at least considering. And there surely are further options.

As indicated elsewhere, my preference goes towards reverting the final one or two patches of that series. They can be re-applied once the dependencies were properly sorted, which may (as per above) involve properly introducing a DOMCTL Kconfig setting first.

Quoted 4 lines
Quoted 1 line

I don't think this is a good idea.

And implicitly you say that what I put under question in the first paragraph is a good way forward?

I think it is OK.

I also think "having SYSCTL depend on DOMCTL" is certainly worth thinking about. In terms of privilege and potential for interference with other domains sysctl and domctl don't seem different so it is unlikely one would want to disable one but not the other.

Another idea is to have a single kconfig for both SYSCTL and DOMCTL: we don't necessarily need to offer individual kconfig for every feature. From a safety point of view, we want to disable them both.

#5 lore raw
Quoted 38 lines · Stefano Stabellini
Quoted 30 lines · Jan Beulich
Quoted 29 lines · Stefano Stabellini
Quoted 27 lines · Jan Beulich
Quoted 6 lines · Penny Zheng

Function getdomaininfo() is not only invoked by domctl-op, but also sysctl-op, so it shall better live in domain.c, rather than domctl.c. Which is also applied for arch_get_domain_info(). Style corrections shall be applied at the same time while moving these functions, such as converting u64 to uint64_t.

Quoted 7 lines

The movement could also fix CI error of a randconfig picking both SYSCTL=y and PV_SHIM_EXCLUSIVE=y results in sysctl.c being built, but domctl.c not being built, which leaves getdomaininfo() undefined, causing linking to fail.

Fixes 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")

I'm not convinced of this approach. In the longer run this would mean wrapping everything you move in "#if defined(CONFIG_SYSCTL) || defined(CONFIG_DOMCTL)", which I consider undesirable. Without DOMCTL, the usefulness of XEN_SYSCTL_getdomaininfolist is at least questionable. Therefore adding more isolated "#ifdef CONFIG_DOMCTL" just there may be an option. Similarly, as mentioned on the other thread, having SYSCTL depend on DOMCTL is an approach which imo wants at least considering. And there surely are further options.

As indicated elsewhere, my preference goes towards reverting the final one or two patches of that series. They can be re-applied once the dependencies were properly sorted, which may (as per above) involve properly introducing a DOMCTL Kconfig setting first.

Quoted 4 lines
Quoted 1 line

I don't think this is a good idea.

And implicitly you say that what I put under question in the first paragraph is a good way forward?

I think it is OK.

Quoted 8 lines

I also think "having SYSCTL depend on DOMCTL" is certainly worth thinking about. In terms of privilege and potential for interference with other domains sysctl and domctl don't seem different so it is unlikely one would want to disable one but not the other.

Another idea is to have a single kconfig for both SYSCTL and DOMCTL: we don't necessarily need to offer individual kconfig for every feature. From a safety point of view, we want to disable them both.

Then again (and going against the thought of making SYSCTL depend on DOMCTL) there may be a desire to query / alter certain properties of the system as a whole, without also having that need for individual domains. But yes, covering both with a single control also is an option to consider.

Jan

#6 lore raw
Quoted 44 lines · Jan Beulich
Quoted 43 lines · Stefano Stabellini
Quoted 30 lines · Jan Beulich
Quoted 29 lines · Stefano Stabellini
Quoted 27 lines · Jan Beulich
Quoted 6 lines · Penny Zheng

Function getdomaininfo() is not only invoked by domctl-op, but also sysctl-op, so it shall better live in domain.c, rather than domctl.c. Which is also applied for arch_get_domain_info(). Style corrections shall be applied at the same time while moving these functions, such as converting u64 to uint64_t.

Quoted 7 lines

The movement could also fix CI error of a randconfig picking both SYSCTL=y and PV_SHIM_EXCLUSIVE=y results in sysctl.c being built, but domctl.c not being built, which leaves getdomaininfo() undefined, causing linking to fail.

Fixes 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")

I'm not convinced of this approach. In the longer run this would mean wrapping everything you move in "#if defined(CONFIG_SYSCTL) || defined(CONFIG_DOMCTL)", which I consider undesirable. Without DOMCTL, the usefulness of XEN_SYSCTL_getdomaininfolist is at least questionable. Therefore adding more isolated "#ifdef CONFIG_DOMCTL" just there may be an option. Similarly, as mentioned on the other thread, having SYSCTL depend on DOMCTL is an approach which imo wants at least considering. And there surely are further options.

As indicated elsewhere, my preference goes towards reverting the final one or two patches of that series. They can be re-applied once the dependencies were properly sorted, which may (as per above) involve properly introducing a DOMCTL Kconfig setting first.

Quoted 4 lines
Quoted 1 line

I don't think this is a good idea.

And implicitly you say that what I put under question in the first paragraph is a good way forward?

I think it is OK.

I also think "having SYSCTL depend on DOMCTL" is certainly worth thinking about. In terms of privilege and potential for interference with other domains sysctl and domctl don't seem different so it is unlikely one would want to disable one but not the other.

Quoted 8 lines
Quoted 3 lines

Another idea is to have a single kconfig for both SYSCTL and DOMCTL: we don't necessarily need to offer individual kconfig for every feature. From a safety point of view, we want to disable them both.

Then again (and going against the thought of making SYSCTL depend on DOMCTL) there may be a desire to query / alter certain properties of the system as a whole, without also having that need for individual domains. But yes, covering both with a single control also is an option to consider.

If making SYSCTL depend on DOMCTL and/or a single kconfig for both SYSCTL and DOMCTL are both way forward, then we can take this patch as is?

#7 lore raw
Quoted 49 lines · Stefano Stabellini
Quoted 48 lines · Jan Beulich
Quoted 46 lines · Stefano Stabellini
Quoted 30 lines · Jan Beulich
Quoted 29 lines · Stefano Stabellini
Quoted 27 lines · Jan Beulich
Quoted 6 lines · Penny Zheng

Function getdomaininfo() is not only invoked by domctl-op, but also sysctl-op, so it shall better live in domain.c, rather than domctl.c. Which is also applied for arch_get_domain_info(). Style corrections shall be applied at the same time while moving these functions, such as converting u64 to uint64_t.

Quoted 7 lines

The movement could also fix CI error of a randconfig picking both SYSCTL=y and PV_SHIM_EXCLUSIVE=y results in sysctl.c being built, but domctl.c not being built, which leaves getdomaininfo() undefined, causing linking to fail.

Fixes 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")

I'm not convinced of this approach. In the longer run this would mean wrapping everything you move in "#if defined(CONFIG_SYSCTL) || defined(CONFIG_DOMCTL)", which I consider undesirable. Without DOMCTL, the usefulness of XEN_SYSCTL_getdomaininfolist is at least questionable. Therefore adding more isolated "#ifdef CONFIG_DOMCTL" just there may be an option. Similarly, as mentioned on the other thread, having SYSCTL depend on DOMCTL is an approach which imo wants at least considering. And there surely are further options.

As indicated elsewhere, my preference goes towards reverting the final one or two patches of that series. They can be re-applied once the dependencies were properly sorted, which may (as per above) involve properly introducing a DOMCTL Kconfig setting first.

Quoted 4 lines
Quoted 1 line

I don't think this is a good idea.

And implicitly you say that what I put under question in the first paragraph is a good way forward?

I think it is OK.

I also think "having SYSCTL depend on DOMCTL" is certainly worth thinking about. In terms of privilege and potential for interference with other domains sysctl and domctl don't seem different so it is unlikely one would want to disable one but not the other.

Another idea is to have a single kconfig for both SYSCTL and DOMCTL: we don't necessarily need to offer individual kconfig for every feature. From a safety point of view, we want to disable them both.

Quoted 8 lines
Quoted 4 lines

Then again (and going against the thought of making SYSCTL depend on DOMCTL) there may be a desire to query / alter certain properties of the system as a whole, without also having that need for individual domains. But yes, covering both with a single control also is an option to consider.

If making SYSCTL depend on DOMCTL and/or a single kconfig for both SYSCTL and DOMCTL are both way forward, then we can take this patch as is?

In both of the named cases this patch simply wouldn't be needed. Once the conversion work was done, that is. And to be frank, I'm not happy to see the function move out and then back in.

Jan

#8 lore raw

[Public]

Quoted 71 lines

-----Original Message-----
From: Jan Beulich <[email protected]>
Sent: Friday, July 25, 2025 1:38 PM
To: Stefano Stabellini <[email protected]>
Cc: Penny, Zheng <[email protected]>; Huang, Ray <[email protected]>; Julien Grall <[email protected]>; Bertrand Marquis <[email protected]>; Orzel, Michal <[email protected]>; Volodymyr Babchuk <[email protected]>; Andrew Cooper <[email protected]>; Anthony PERARD <[email protected]>; Roger Pau Monné <[email protected]>; Daniel P. Smith <[email protected]>; [email protected]
Subject: Re: [PATCH v1] xen: move getdomaininfo() to domain.c

Quoted 12 lines · Stefano Stabellini
Quoted 11 lines · Jan Beulich
Quoted 10 lines · Stefano Stabellini
Quoted 9 lines · Jan Beulich
Quoted 8 lines · Stefano Stabellini
Quoted 7 lines · Jan Beulich
Quoted 6 lines · Penny Zheng

Function getdomaininfo() is not only invoked by domctl-op, but also sysctl-op, so it shall better live in domain.c, rather than domctl.c. Which is also applied for arch_get_domain_info(). Style corrections shall be applied at the same time while moving these functions, such as converting u64 to uint64_t.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

The movement could also fix CI error of a randconfig picking both SYSCTL=y and PV_SHIM_EXCLUSIVE=y results in sysctl.c being built, but domctl.c not being built, which leaves getdomaininfo()

undefined, causing linking to fail.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Fixes 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

I'm not convinced of this approach. In the longer run this would mean wrapping everything you move in "#if defined(CONFIG_SYSCTL) || defined(CONFIG_DOMCTL)", which I consider undesirable. Without DOMCTL, the usefulness of XEN_SYSCTL_getdomaininfolist is at least questionable. Therefore adding more isolated "#ifdef CONFIG_DOMCTL" just there may be an option. Similarly, as mentioned on the other thread, having SYSCTL depend on DOMCTL is an

approach which imo wants at least considering. And there surely are further options.

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 10 lines
Quoted 7 lines
Quoted 5 lines

As indicated elsewhere, my preference goes towards reverting the final one or two patches of that series. They can be re-applied once the dependencies were properly sorted, which may (as per above) involve properly introducing a DOMCTL Kconfig setting first.

I don't think this is a good idea.

And implicitly you say that what I put under question in the first paragraph is a good way forward?

I think it is OK.

I also think "having SYSCTL depend on DOMCTL" is certainly worth thinking about. In terms of privilege and potential for interference with other domains sysctl and domctl don't seem different so it is unlikely one would want to disable one but not the other.

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

Another idea is to have a single kconfig for both SYSCTL and DOMCTL:
we don't necessarily need to offer individual kconfig for every feature. From a safety point of view, we want to disable them both.

Then again (and going against the thought of making SYSCTL depend on DOMCTL) there may be a desire to query / alter certain properties of the system as a whole, without also having that need for individual domains. But yes, covering both with a single control also is an option to

consider.

Quoted 1 line
Quoted 8 lines
Quoted 3 lines

If making SYSCTL depend on DOMCTL and/or a single kconfig for both SYSCTL and DOMCTL are both way forward, then we can take this patch as is?

In both of the named cases this patch simply wouldn't be needed. Once the conversion work was done, that is. And to be frank, I'm not happy to see the function move out and then back in.

I think the new patch "move domctl.o out of PV_SHIM_EXCLUSIVE " could also fix getdomaininfo() linking error

Quoted 1 line

Jan

#9 lore raw
In reply to Jan Beulich

[Public]

Quoted 29 lines

-----Original Message-----
From: Jan Beulich <[email protected]>
Sent: Tuesday, July 22, 2025 3:16 PM
To: Penny, Zheng <[email protected]>
Cc: Huang, Ray <[email protected]>; Stefano Stabellini <[email protected]>; Julien Grall <[email protected]>; Bertrand Marquis <[email protected]>; Orzel, Michal <[email protected]>; Volodymyr Babchuk <[email protected]>; Andrew Cooper <[email protected]>; Anthony PERARD <[email protected]>; Roger Pau Monné <[email protected]>; Daniel P. Smith <[email protected]>; [email protected]
Subject: Re: [PATCH v1] xen: move getdomaininfo() to domain.c

Quoted 9 lines · Penny Zheng

Function getdomaininfo() is not only invoked by domctl-op, but also sysctl-op, so it shall better live in domain.c, rather than domctl.c. Which is also applied for arch_get_domain_info(). Style corrections shall be applied at the same time while moving these functions, such as converting u64 to uint64_t.

The movement could also fix CI error of a randconfig picking both SYSCTL=y and PV_SHIM_EXCLUSIVE=y results in sysctl.c being built, but domctl.c not being built, which leaves getdomaininfo() undefined, causing linking

to fail.

Quoted 4 lines
Fixes 34317c508294 ("xen/sysctl: wrap around sysctl hypercall")
Quoted 9 lines

I'm not convinced of this approach. In the longer run this would mean wrapping everything you move in "#if defined(CONFIG_SYSCTL) || defined(CONFIG_DOMCTL)", which I consider undesirable. Without DOMCTL, the usefulness of XEN_SYSCTL_getdomaininfolist is at least questionable. Therefore adding more isolated "#ifdef CONFIG_DOMCTL" just there may be an option. Similarly, as mentioned on the other thread, having SYSCTL depend on DOMCTL is an approach which imo wants at least considering. And there surely are further options.

Yes, later when introducing CONFIG_DOMCTL. I intend to wrap getdomaininfo() with "#if defined(CONFIG_SYSCTL) || defined(CONFIG_DOMCTL)". imo, getdomaininfo() is to achieve domain info, domctl-op use it to get per-domain info and sysctl-op use it to get system-wide, all-domain info, That's why I suggest to move it to more common location domain.c.
Apart from it, we will have functions like, cpumask_to_xenctl_bitmap(), etc, generic type-conversion helper, needs such wrapping. That's all the scenario fwis.

Quoted 6 lines

As indicated elsewhere, my preference goes towards reverting the final one or two patches of that series. They can be re-applied once the dependencies were properly sorted, which may (as per above) involve properly introducing a DOMCTL Kconfig setting first.

Jan