Function domain_soft_reset() is responsible for domain soft reset domctl-op,
and shall be wrapped with CONFIG_MGMT_HYPERCALLS
Tracking its calling chain, and the following functions shall also be wrapped
with CONFIG_MGMT_HYPERCALLS:
- grant_table_warn_active_grants()
- argo_soft_reset()
- arch_domain_soft_reset()
Wrap XEN_DOMCTL_soft_reset-case transiently with CONFIG_MGMT_HYPERCALLS, and
it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the
common/domctl.c in the last.
Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
---
v1 -> v2:
- remove unnessary wrapping in stub.c
- adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS"
- wrap XEN_DOMCTL_soft_reset-case transiently
---
xen/arch/arm/domain.c | 2 ++
xen/arch/x86/domain.c | 2 ++
xen/common/argo.c | 2 ++
xen/common/domain.c | 2 ++
xen/common/domctl.c | 2 ++
xen/common/grant_table.c | 2 ++
6 files changed, 12 insertions(+)
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 1a8585d02b..30ff9dac46 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -875,10 +875,12 @@ void arch_domain_unpause(struct domain *d)
{
}
+#ifdef CONFIG_MGMT_HYPERCALLS
int arch_domain_soft_reset(struct domain *d)
{
return -ENOSYS;
}
+#endif /* CONFIG_MGMT_HYPERCALLS */
void arch_domain_creation_finished(struct domain *d)
{
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 19fd86ce88..5b3c5e8caf 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1030,6 +1030,7 @@ void arch_domain_unpause(struct domain *d)
viridian_time_domain_thaw(d);
}
+#ifdef CONFIG_MGMT_HYPERCALLS
int arch_domain_soft_reset(struct domain *d)
{
struct page_info *page = virt_to_page(d->shared_info), *new_page;
@@ -1131,6 +1132,7 @@ int arch_domain_soft_reset(struct domain *d)
return ret;
}
+#endif /* CONFIG_MGMT_HYPERCALLS */
void arch_domain_creation_finished(struct domain *d)
{
diff --git a/xen/common/argo.c b/xen/common/argo.c
index cbe8911a43..a451546d57 100644
--- a/xen/common/argo.c
+++ b/xen/common/argo.c
@@ -2351,6 +2351,7 @@ argo_destroy(struct domain *d)
write_unlock(&L1_global_argo_rwlock);
}
+#ifdef CONFIG_MGMT_HYPERCALLS
void
argo_soft_reset(struct domain *d)
{
@@ -2374,3 +2375,4 @@ argo_soft_reset(struct domain *d)
write_unlock(&L1_global_argo_rwlock);
}
+#endif /* CONFIG_MGMT_HYPERCALLS */
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 976172c7d3..678e81b400 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1689,6 +1689,7 @@ void domain_unpause_except_self(struct domain *d)
domain_unpause(d);
}
+#ifdef CONFIG_MGMT_HYPERCALLS
int domain_soft_reset(struct domain *d, bool resuming)
{
struct vcpu *v;
@@ -1726,6 +1727,7 @@ int domain_soft_reset(struct domain *d, bool resuming)
return rc;
}
+#endif /* CONFIG_MGMT_HYPERCALLS */
int vcpu_reset(struct vcpu *v)
{
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 0061d7972a..1c0bfd456e 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -467,6 +467,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
break;
}
+#ifdef CONFIG_MGMT_HYPERCALLS
case XEN_DOMCTL_soft_reset:
case XEN_DOMCTL_soft_reset_cont:
if ( d == current->domain ) /* no domain_pause() */
@@ -485,6 +486,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
ret = -EFAULT;
}
break;
+#endif /* CONFIG_MGMT_HYPERCALLS */
case XEN_DOMCTL_destroydomain:
ret = domain_kill(d);
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index cf131c43a1..24ef1205c9 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3962,6 +3962,7 @@ int gnttab_release_mappings(struct domain *d)
return 0;
}
+#ifdef CONFIG_MGMT_HYPERCALLS
void grant_table_warn_active_grants(struct domain *d)
{
struct grant_table *gt = d->grant_table;
@@ -4006,6 +4007,7 @@ void grant_table_warn_active_grants(struct domain *d)
#undef WARN_GRANT_MAX
}
+#endif /* CONFIG_MGMT_HYPERCALLS */
void
grant_table_destroy(
--
2.34.1