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 <[email protected]>
---
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