[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 08/25] xen/domctl: wrap around XEN_DOMCTL_soft_reset


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Sun, 3 Aug 2025 17:47:21 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HDWkHlpI39c3TP608GAZB0w6tfc2X4mcFFWinzeznro=; b=VTGhga+yddrkDRbQtkn3vXeWViNdrmclJopgtmFtmsoiLmF5QPaqLsIy8qMnuXbrESl7dAT01bQXrOEWd6+WO+UrGAANOIATbCkdcsbwwDKwh3OrZczWXiUXQr2I5Of94JlMnsZuzaCEQePrfLoO1Ff58yfcYo0najX2GIigKJ/1s/brs8v+BZ7gGtOSv7AhxoWmRMnCh+EICfL1rwx2N7EV4aUscnHuhlVPOiSzaj6FfeLAdtKxHsswa6RNoTOBhHWwZswydE0kEM0BIBqL0mGmtlCS8zJwpQlZqUILrkkSaHw9xPvzcVogVzh8ux0g0g1HJzK1ec38wjwGLuSTBg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=azcmPV1WUxrPHk1m/KGU78+S5aIClRoq9MqGYaZtU10oBOzPMvMcpSvYzoafQ0E2F2o/2PL6MdI6sbBBb987jM7ZBG7wijefbZRHEkgxHSfZJWj6H7mlpO/MtmPoTr3T0IEtcJ0gZQT0tp0R/9QHCl1zTO2bWTmWDiPNrCh4cHu+ECIu3oNg2REwzZpaY7Xhgq8Kt5oRePcssWn/7tso5868325JoIkDshBGxq6et99v4hwrqs8GDwx0Xnb6mzpesrVOQhx2ib7n6EvcsOkDxTzOOo17NRygJOgrFAUIAV3C9GkX3lxKJDx0fPCvW5jPOrz3CIC/ScStfYNd9YeQAw==
  • Cc: <ray.huang@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, "Oleksii Kurochko" <oleksii.kurochko@xxxxxxxxx>, Christopher Clark <christopher.w.clark@xxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Sun, 03 Aug 2025 09:48:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Function domain_soft_reset() is responsible for domain soft reset, tracking
its calling chain, and the following functions could also be wrapped:
- grant_table_warn_active_grants()
- argo_soft_reset()
- arch_domain_soft_reset()
- domain_resume(), another usage is in XEN_DOMCTL_resumedomain domctl-op.

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
---
 xen/arch/arm/domain.c    | 2 ++
 xen/arch/ppc/stubs.c     | 2 ++
 xen/arch/riscv/stubs.c   | 2 ++
 xen/arch/x86/domain.c    | 2 ++
 xen/common/argo.c        | 2 ++
 xen/common/domain.c      | 4 ++++
 xen/common/grant_table.c | 2 ++
 7 files changed, 16 insertions(+)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 310c578909..4124d201d1 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -870,10 +870,12 @@ void arch_domain_unpause(struct domain *d)
 {
 }
 
+#ifdef CONFIG_DOMCTL
 int arch_domain_soft_reset(struct domain *d)
 {
     return -ENOSYS;
 }
+#endif /* CONFIG_DOMCTL */
 
 void arch_domain_creation_finished(struct domain *d)
 {
diff --git a/xen/arch/ppc/stubs.c b/xen/arch/ppc/stubs.c
index 4679cf9360..b2b97c6eb7 100644
--- a/xen/arch/ppc/stubs.c
+++ b/xen/arch/ppc/stubs.c
@@ -236,10 +236,12 @@ void arch_domain_unpause(struct domain *d)
     BUG_ON("unimplemented");
 }
 
+#ifdef CONFIG_DOMCTL
 int arch_domain_soft_reset(struct domain *d)
 {
     BUG_ON("unimplemented");
 }
+#endif /* CONFIG_DOMCTL */
 
 void arch_domain_creation_finished(struct domain *d)
 {
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index 8918cebf35..4f817bfe83 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -208,10 +208,12 @@ void arch_domain_unpause(struct domain *d)
     BUG_ON("unimplemented");
 }
 
+#ifdef CONFIG_DOMCTL
 int arch_domain_soft_reset(struct domain *d)
 {
     BUG_ON("unimplemented");
 }
+#endif /* CONFIG_DOMCTL */
 
 void arch_domain_creation_finished(struct domain *d)
 {
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 56c3816187..13ccaf1c79 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1001,6 +1001,7 @@ void arch_domain_unpause(struct domain *d)
         viridian_time_domain_thaw(d);
 }
 
+#ifdef CONFIG_DOMCTL
 int arch_domain_soft_reset(struct domain *d)
 {
     struct page_info *page = virt_to_page(d->shared_info), *new_page;
@@ -1102,6 +1103,7 @@ int arch_domain_soft_reset(struct domain *d)
 
     return ret;
 }
+#endif /* CONFIG_DOMCTL */
 
 void arch_domain_creation_finished(struct domain *d)
 {
diff --git a/xen/common/argo.c b/xen/common/argo.c
index cbe8911a43..932f9fde9b 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_DOMCTL
 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_DOMCTL */
diff --git a/xen/common/domain.c b/xen/common/domain.c
index e20fe2d40d..604217d782 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1343,6 +1343,7 @@ int domain_shutdown(struct domain *d, u8 reason)
     return 0;
 }
 
+#ifdef CONFIG_DOMCTL
 void domain_resume(struct domain *d)
 {
     struct vcpu *v;
@@ -1369,6 +1370,7 @@ void domain_resume(struct domain *d)
 
     domain_unpause(d);
 }
+#endif /* CONFIG_DOMCTL */
 
 int vcpu_start_shutdown_deferral(struct vcpu *v)
 {
@@ -1681,6 +1683,7 @@ void domain_unpause_except_self(struct domain *d)
         domain_unpause(d);
 }
 
+#ifdef CONFIG_DOMCTL
 int domain_soft_reset(struct domain *d, bool resuming)
 {
     struct vcpu *v;
@@ -1718,6 +1721,7 @@ int domain_soft_reset(struct domain *d, bool resuming)
 
     return rc;
 }
+#endif /* CONFIG_DOMCTL */
 
 int vcpu_reset(struct vcpu *v)
 {
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index cf131c43a1..bfb199be7f 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_DOMCTL
 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_DOMCTL */
 
 void
 grant_table_destroy(
-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.