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

Re: [PATCH 3/4] domctl: Provide appropriate error code when VM events are not supported


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Milan Djokic <milan_djokic@xxxxxxxx>
  • Date: Tue, 9 Dec 2025 13:57:53 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • 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=Rnu1EVaf75BVue/HxCCuOvScGtBK4r3193HsbvfeH8Q=; b=nAeOnS3cWyp0fWLO4oXwMu/sraG4fAwUByyrPn+LBfC0ft8f/JuuJDeouGbnHpeNjX1n5qD3S+P61QZIdfKVfU2dObuLeozOJqIkS02a0bgvAGVekW0WDh/hUGiJSkmGB6LAS5tSeMjg3GOHuj/E50mmh7FYrZcP1SKzkSScoXpU4nlNQhzTo/zhJAzcFRnNVXs/Gru/ENXCbs6GVyP/+wWZnTEdLRrMN8U/QRVuJI8DbC17f2D42rgSElGXu7tej8lT31ZCnksnyGlJ1i7K7XPx9y3QDwzmk3EVc6jbNCdb+yaCMwVa11lqBXeo+ohkzC3r/oYS4xmxZ1arl3+WAA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rtxsKG1QpZ07Pac5XvlAj7pyzoz0akMQF6ymunGSq7+SH6kyxRgKEjt/mQhmWQIGwWJbvkujndg46Wtx6iFNHaA/LTRL2XuPjOEhZB+wi0Lh8AbJ3ivoU9vOvHB2iuz3CQbAQAgtBCtcrb32ZQnbeDJOKhDv51o4FXxAlLjdb8eEgGbIcODiqSMBWxqvMW+iMlbgo9lbTxCm1WKGZ7knY1EKiYU0myoGsaL1ZyU/gD6dXVn8PlMd1L1w+7iRAgefBNhs8eeIGQCJGCgwPFYkMtexzRE62SWIyeRgFf5/UFXK3J5jC50TZr4qvLUHqhY3pDbljG+72xbidaHKsMUdmQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 09 Dec 2025 12:58:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12/8/25 14:24, Jan Beulich wrote:
On 05.12.2025 21:36, Milan Djokic wrote:
Return -EOPNOTSUPP when XEN_DOMCTL_set_access_required command is invoked
while VM events and monitoring support is disabled.

This is more bounded than the pretty wide subject. Taking the subject and
considering there are other VM_EVENT related domctl-s, is this one really
the only one in need of adjustment?


I think that others, like monitor_op and event_op, already return -EOPNOTSUPP when CONFIG_VM_EVENT is disabled. I will check this, it could be that I missed some commands related to this context.

--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -787,19 +787,22 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
u_domctl)
              copyback = true;
          break;
-#ifdef CONFIG_VM_EVENT
      case XEN_DOMCTL_set_access_required:
-        if ( unlikely(current->domain == d) ) /* no domain_pause() */
-            ret = -EPERM;
+        if ( !IS_ENABLED(CONFIG_VM_EVENT) )
+            ret = -EOPNOTSUPP;
          else

If you convert this to

         else if ( unlikely(current->domain == d) ) /* no domain_pause() */

then ...

          {
-            domain_pause(d);
-            arch_p2m_set_access_required(d,
-                op->u.access_required.access_required);
-            domain_unpause(d);
+            if ( unlikely(current->domain == d) ) /* no domain_pause() */
+                ret = -EPERM;
+            else
+            {
+                domain_pause(d);
+                arch_p2m_set_access_required(d,
+                    op->u.access_required.access_required);
+                domain_unpause(d);
+            }

... the need for re-indenting disappears, and we get away with less churn.


I’ll do that, thanks.

BR,
Milan




 


Rackspace

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