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

[PATCH v3 14/28] xen/domctl: wrap domain_resume() with CONFIG_MGMT_HYPERCALLS


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Mon, 13 Oct 2025 18:15:26 +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=SyANdC3k7aP7WUEmBjJUqOcnGAygkfaCGTkQVbLp+cc=; b=NtFtKQEsIyKom6gd4A1Af8j2QVFrGL0+x787FWQl4fx7MQHKyikL5hAzgoj3qqmu0Aq8vuZhCJePui405ad9dgFz2cWsNEi2KksPTAYQjuI/PoFxH6vpU9ir9BPmh9qdElXqPvp3eX5xBvmjG1foydMDc5AvdqMXBv/AwqODAdjkmXjpCulbdGB8pF/3Az4EG7KekK+OZEjA6gcq6+kP1fcDFFA+qxDI7gTx20P7GG8BBxVriVsgbHFoSiLaqU8SCEM9B//DbN2YOK0Hj+kwduQbwSWO0sdSGBm+bC/S0oxrvvudqjrJzAlk/slFgwHw444kERojljLFGuqiXc2psQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ITUoKqvYFBnv6JqoApo/bZ9Mnc9tXyPpsarLaG2g4Sk5v2XeZgS2aHvK+7Du2qldWR/tHcdnBZ/Z8Bu5ghzdetze5HE/NHmqFYcUz1P6VwBjGDSIhQmBTNBzHqi+B+bqGkfYF0NYtGs9HGNKVhtBCxOl2znu3AF+e5ajBOUoDhA5C4QOXed5pnwitCbx4Kkod6dnT+KS9ZQvii3nCZ3GbMhKv1jKF/FalFpeWnys/4Pd9eTg0IUvZz9zZ+KAlkXeRgpIId6LSIJ3yv4q+W9wQ4OHvljD4L3RKIBZdcUfWHL/OXyy6Ai1PZm7OFY9ipIQFMWz9RvnCvg0CvTyOxWwpA==
  • Cc: <ray.huang@xxxxxxx>, <oleksii.kurochko@xxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "Anthony PERARD" <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 13 Oct 2025 10:26:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

One usage of function domain_resume() is in domain resume domctl-op, and
the other is in domain_soft_reset(), which is already guarded with
CONFIG_MGMT_HYPERCALLS.
So we could wrap domain_resume() with CONFIG_MGMT_HYPERCALLS. Otherwise
it will become unreachable codes when MGMT_HYPERCALLS=n and hence violating
Misra rule 2.1.

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
v1 -> v2:
- new commit
---
v2 -> v3:
- remove transient wrapping around XEN_DOMCTL_resumedomain-case
- address "violating Misra rule 2.1" in commit message
---
 xen/common/domain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 678e81b400..34e2e501dc 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1351,6 +1351,7 @@ int domain_shutdown(struct domain *d, u8 reason)
     return 0;
 }
 
+#ifdef CONFIG_MGMT_HYPERCALLS
 void domain_resume(struct domain *d)
 {
     struct vcpu *v;
@@ -1377,6 +1378,7 @@ void domain_resume(struct domain *d)
 
     domain_unpause(d);
 }
+#endif /* CONFIG_MGMT_HYPERCALLS */
 
 int vcpu_start_shutdown_deferral(struct vcpu *v)
 {
-- 
2.34.1




 


Rackspace

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