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

Re: [PATCH 2/4] domctl: Provide appropriate error code when PIRQs are not supported


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Mon, 8 Dec 2025 23:44:25 +0200
  • 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=XaceH2yTTW7R0FX7Ph5XRZ16Jx/b2pfEswPV2OYmNAk=; b=ecPCJKvwRAwrg7KB2AwozBL0djiZOIogZeUHQFpUS7yI/09K2eSbLSo/O712k0EYCNW9SrOgFfEWspK65jfpHToAPDK2/hbVzArfunIlax1SPw8qIS8VTT77/I2AcdnYTpbAJr7bzEha3iYVoDSOocfx0324XaQvEymwKTVLbX+VXaKOl5bUDTfW3P8iLrpus/NBHf2G/Aw+xY0v4P7pvp0PSPG6tMhREAe/CsKqKL1RJMF98r3gmytToSNhP0+ShzVnnq3SGKM8zcJc/d+zETizymuf0+k5B96pJTn2F/Xdgx0OQ52PA432wCdDFwsfq8JHsvheVqL290eJvcF2GQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XlMhamKnvJPyMvof1eaPLPI5LyhOV7c/6XhtbDM9sBfqJMUbBtg6BhPqNbKGmEBR8Y7+HkwdK3i+lsVjBdQmuQaJwzO4NRIJL7JjJId+v7lZ6nqh75BYLlc6q9j0NQ+FxptOQz9o1eOh1j4xSrpiM1pczKFhM2tJh2RaoZeYhpi8WN+b1RRzUo+6xdJz50qMll/bD92Z5aB9E/oT0bGjjaWxdMAfTgIxgCL6sATEHGdWNqu4Uc8KZsvsdW4g7OO4aWPUGt9n81KQEt0xtJXeOPKqiZIlRuK7TVLbvty5frU3g+PQMkeIUVv0npRbg9kcglH2Jq/Fov7L9yOIypFtyg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Delivery-date: Mon, 08 Dec 2025 21:44:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Milan,

Thank you for your patch.

On 05.12.25 22:36, Milan Djokic wrote:
When PIRQs are not supported (e.g. for arm), XEN_DOMCTL_irq_permission
command is not handled.
This results with default (-ENOSYS) error code returned to control domain.
Update command handling to return -EOPNOTSUPP if control domain
invokes it by mistake when PIRQs are not supported.

Also exclude xsm_irq_permission hooks from compilation when
PIRQs are not supported.

Could you please do not mix such a clean up a changes with functional changes?
It deserve to be standalone patch.


Signed-off-by: Milan Djokic <milan_djokic@xxxxxxxx>
---
  xen/common/domctl.c     | 6 ++++--
  xen/include/xsm/dummy.h | 4 ++--
  xen/include/xsm/xsm.h   | 6 ++++--
  xen/xsm/dummy.c         | 2 ++
  xen/xsm/flask/hooks.c   | 5 ++++-
  5 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 29a7726d32..159864bc99 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -638,9 +638,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
u_domctl)
          }
          break;
-#ifdef CONFIG_HAS_PIRQ
      case XEN_DOMCTL_irq_permission:
      {
+#ifdef CONFIG_HAS_PIRQ
          unsigned int pirq = op->u.irq_permission.pirq, irq;
          int allow = op->u.irq_permission.allow_access;
@@ -656,9 +656,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
              ret = irq_permit_access(d, irq);
          else
              ret = irq_deny_access(d, irq);
+#else
+        ret = -EOPNOTSUPP;
+#endif
          break;
      }
-#endif
case XEN_DOMCTL_iomem_permission:
      {
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index e801dbcdba..6f6de161f9 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -555,14 +555,14 @@ static XSM_INLINE int cf_check xsm_unmap_domain_irq(
      XSM_ASSERT_ACTION(XSM_HOOK);
      return xsm_default_action(action, current->domain, d);
  }
-
+#ifdef CONFIG_HAS_PIRQ
  static XSM_INLINE int cf_check xsm_irq_permission(
      XSM_DEFAULT_ARG struct domain *d, int pirq, uint8_t allow)
  {
      XSM_ASSERT_ACTION(XSM_HOOK);
      return xsm_default_action(action, current->domain, d);
  }
-

[...]

--
Best regards,
-grygorii




 


Rackspace

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