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

Re: [PATCH 03/24] XSM: make .{,un}map_domain_pirq() hooks dependent upon HAS_PIRQ=y


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Sun, 2 Aug 2026 10:50:41 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785682237; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=ISvWVng+FYKzx5n50hE5vRcVh5WIYwczRj0Moy6WDrY=; b=TXiza9+cibhr+Q3vJN7h6Ai3c2NdqlnGZM5uj2qf/cHtFLcL5QfRTZWKXa8UKnPNeYGmuS7TvUKnuG/jFEEFoUBy8+I3gciUzBJF3L8/NaRCDaqjosGitA88VHkfMU42f9Gv5eJU9pvwnhTAqEVeHbKcdSIXob2hTwoUTKV4fQo=
  • Arc-seal: i=1; a=rsa-sha256; t=1785682237; cv=none; d=zohomail.com; s=zohoarc; b=BjJvg9Ur3O4HJe/WTBimbNZYGF8Cq7NcfHKEaHEXLkbVWTnOT+A/KzPVTYUT1i+Hv7fW94VSMXONHgr78zK3QejinALH/X8dvIeZgbOfCknOzpe9BiwOZF9MBT2sfszSu6yNcLdByXet3m+vv88VuM2JuD7oECwf6NV16fLOpc0=
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@xxxxxxxxxxxxxxxxxxxx" header.h="Message-ID:Date:MIME-Version:Subject:To:From:In-Reply-To:Content-Type:Content-Transfer-Encoding"
  • Delivery-date: Sun, 02 Aug 2026 14:50:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 7/28/26 9:14 AM, Jan Beulich wrote:
They're unreachable / dead otherwise.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -450,6 +450,8 @@ static XSM_INLINE char *cf_check xsm_sho
      return NULL;
  }
+#ifdef CONFIG_HAS_PIRQ
+
  static XSM_INLINE int cf_check xsm_map_domain_pirq(
      XSM_DEFAULT_ARG struct domain *d)
  {
@@ -457,17 +459,19 @@ static XSM_INLINE int cf_check xsm_map_d
      return xsm_default_action(action, current->domain, d);
  }
-static XSM_INLINE int cf_check xsm_map_domain_irq(
-    XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
+static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
+    XSM_DEFAULT_ARG struct domain *d)
  {
-    XSM_ASSERT_ACTION(XSM_HOOK);
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
      return xsm_default_action(action, current->domain, d);
  }
-static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
-    XSM_DEFAULT_ARG struct domain *d)
+#endif /* CONFIG_HAS_PIRQ */
+
+static XSM_INLINE int cf_check xsm_map_domain_irq(
+    XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
  {
-    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    XSM_ASSERT_ACTION(XSM_HOOK);
      return xsm_default_action(action, current->domain, d);
  }
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -65,9 +65,12 @@ XSM_HOOK(int, kexec)
XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *) +#ifdef CONFIG_HAS_PIRQ
  XSM_HOOK(int, map_domain_pirq, struct domain *)
-XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
  XSM_HOOK(int, unmap_domain_pirq, struct domain *)
+#endif
+
+XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
  XSM_HOOK(int, unmap_domain_irq, struct domain *, int, const void *)
  XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
  XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1018,11 +1018,20 @@ static char *cf_check flask_show_irq_sid
      return ctx;
  }
+#ifdef CONFIG_HAS_PIRQ
+
  static int cf_check flask_map_domain_pirq(struct domain *d)
  {
      return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
  }
+static int cf_check flask_unmap_domain_pirq(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+}
+
+#endif /* CONFIG_HAS_PIRQ */
+
  static int flask_map_domain_msi (
      struct domain *d, int irq, const void *data, uint32_t *sid,
      struct avc_audit_data *ad)
@@ -1085,11 +1094,6 @@ static int cf_check flask_map_domain_irq
      return rc;
  }
-static int cf_check flask_unmap_domain_pirq(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
-}
-
  static int flask_unmap_domain_msi (
      struct domain *d, int irq, const void *data, uint32_t *sid,
      struct avc_audit_data *ad)


Acked-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>



 


Rackspace

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