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

[PATCH v3 27/28] xen/domctl: make HVM_PARAM_IDENT_PT conditional upon CONFIG_MGMT_HYPERCALLS


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Mon, 13 Oct 2025 18:15:39 +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=Q3Cmxthn8zKCI7zPLmf0c0nfCoguIWJcBZmYje0buDI=; b=R9Jjit4voB4/fCqRqmj+QMd3Vnd4D2DDqqnqiMtTX5vCRlBcHBKVcGhdJPiKM9/I9th21csTcwhz33a7qyWTQbgiwwBZoXjEuilsRg0aT68woqdqOx2PzXhfgylnmv9ZMVhDduCZL9ehbvKfgPADBBx6eJit/cyl9AH8FUL2jsOh5pUyQdndhKMIuoFu3VDUMz6cKRzZ0ezme594os3pIRRRpnV1RGT4JjYPmcI0R6jyAVVtl2zcyUnKRbIDIys4Jcr1ulWUFqlQwzeOFI6U6dFWQeIu/B3cFEMaq8+JuM80Os+lHZVcl8psb5l4Cfmotjop8WoSMpqQLpgNUTkGqw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NZ0m0b7/D/JbRmHeWJboF5hPDt/lqGtRAJFEIxCSYWcDbEvE1xkWIqH3KegcZkTJlQ/nFzOp6om8qQCCcWf61TbjZ9hfqqnFLRAGbx9EF1VvqJhQI10EeTVjENRwPYkdWsiGrBkU16klUxYskZFyHQbVzX40rQ9XkMr7/OBPjdKVwbn8YuFdJ46/Agu1ARuYLjeRx9FtFz1+9qexfaql/c2UXfFDJUt0l+LD/LPASLwMn547J0riMZififgQHeGxH5EWKn89aS0mr5dZLPHEz8DSqhl42BOC6n1lsfoytRTe4Z+bfnuEdCttb1qRWYLrhMYPt6gFUksSIK+OzWp+bQ==
  • Cc: <ray.huang@xxxxxxx>, <oleksii.kurochko@xxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 13 Oct 2025 10:26:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Helper domctl_lock_{acquire,release} is domctl_lock, which HVM_PARAM_IDENT_PT
uses to ensure synchronization and hence being a toolstack-only operation.
So we shall make HVM_PARAM_IDENT_PT conditional upon CONFIG_MGMT_HYPERCALLS,
returning -EOPNOTSUPP when MGMT_HYPERCALLS=n.

Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
---
v2 -> v3:
- new commit
---
 xen/arch/x86/hvm/hvm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e77b0c03ed..e7d630af95 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4281,7 +4281,6 @@ static int hvm_allow_set_param(struct domain *d,
 static int hvm_set_param(struct domain *d, uint32_t index, uint64_t value)
 {
     struct domain *curr_d = current->domain;
-    struct vcpu *v;
     int rc;
 
     rc = hvm_allow_set_param(d, index, value);
@@ -4307,6 +4306,10 @@ static int hvm_set_param(struct domain *d, uint32_t 
index, uint64_t value)
             rc = -EINVAL;
         break;
     case HVM_PARAM_IDENT_PT:
+    {
+#ifdef CONFIG_MGMT_HYPERCALLS
+        struct vcpu *v;
+
         /*
          * Only actually required for VT-x lacking unrestricted_guest
          * capabilities.  Short circuit the pause if possible.
@@ -4334,7 +4337,11 @@ static int hvm_set_param(struct domain *d, uint32_t 
index, uint64_t value)
         domain_unpause(d);
 
         domctl_lock_release();
+#else
+        rc = -EOPNOTSUPP;
+#endif /* CONFIG_MGMT_HYPERCALLS */
         break;
+    }
     case HVM_PARAM_DM_DOMAIN:
         /* The only value this should ever be set to is DOMID_SELF */
         if ( value != DOMID_SELF )
-- 
2.34.1




 


Rackspace

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