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

[PATCH] xen/arm: sci: Don't create a domain with unsatisfied user requests


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 12 May 2026 10:14:42 +0200
  • 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=tKswvIF4y7K3yp5QmM7rqu8Sxek2Dgy5WMsD5+uf7Mc=; b=GBl+HeSTmaNFf92sqYoVsJkvpxrJj+ddOjcmiJEuEbsERb1ZrpSqbamBCcxPklEjKqP2gluCCabkZk9P4uxdowsqge/3pUyELgIpEU/EFWxRZ2yHYHHIVQDYfI0dbAL6Uu1bh43u8QvHGxU9T7yRvWXDTJ2tYrr5QyBSJ67gVSZ5pd+98e/biNv2GuyYjN4FkU/2oEvmTMcdVgV0Nt/+QhjPhJgv0raUlKyTnqPCfIZ1xR9sY/QU6dRWwcqjxMCV2ejlARszfKCIaMPzxLNGr4J4maJ09RZSx7Yp4vvwUPkS9TPFCFCYWBw8pOc0lGbsNGl2AyYdQxvhzKlW+coZyw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=J/vMmPrji07mWzP3W5+CTWrUCYYks8X0OWFaHt0uP45n1FPzhfmge4Ib4VxCewIlJ0GR+mPI+vIS5MRrGSq9BFZvfSLGLHr/sQlAtlleY+WvQYnGVG3NVJT+phQJOcS6sNA31MxVCXjvZXpJ/Iv1Xo4KIdK6Ej4Y5auUnwir6RODL6HICJp7+vTBSj6cZSiwM2nuqHaW8UlsbVN9ZdhpFJVCZhTQ79vLUYZi6JORnJYP1uIj6x/vCf4YmMmxg07QCzwmvFV76ZB0pAAvLPx6szwkLtQv10a2fKz81B399YXCjVwGQQqdpiJ6DoSpq4Ez0ssd+dzsfzEUii/IQHlMAw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksii Moisieiev <oleksii_moisieiev@xxxxxxxx>
  • Delivery-date: Tue, 12 May 2026 08:15:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Arm we stay on the safe side and refuse to create a domain on user
requests (e.g. via xl.cfg, DT options) that cannot be satisfied due to
the feature not being compiled in. SCI fall through the crack and does not
adhere to that i.e. a user request for SCI type other than NONE when
CONFIG_SCMI_SMC (and thus CONFIG_ARM_SCI) is not set would be silently
ignored. Fix it by not allowing anything else other than NONE if the
feature is not enabled.

Fixes: 10e7473d6024 ("xen/arm: scmi-smc: passthrough SCMI SMC to domain, single 
agent")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/arch/arm/dom0less-build.c           | 11 +++++++++--
 xen/arch/arm/include/asm/firmware/sci.h |  5 +++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 6f73c65e5151..52cf788a45ea 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -273,8 +273,7 @@ static int __init domu_dt_sci_parse(struct dt_device_node 
*node,
 
     d_cfg->arch.arm_sci_type = XEN_DOMCTL_CONFIG_ARM_SCI_NONE;
 
-    if ( !IS_ENABLED(CONFIG_ARM_SCI) ||
-         !dt_property_read_bool(node, "xen,sci_type") )
+    if ( !dt_property_read_bool(node, "xen,sci_type") )
         return 0;
 
     ret = dt_property_read_string(node, "xen,sci_type", &sci_type);
@@ -284,7 +283,15 @@ static int __init domu_dt_sci_parse(struct dt_device_node 
*node,
     if ( !strcmp(sci_type, "none") )
         d_cfg->arch.arm_sci_type = XEN_DOMCTL_CONFIG_ARM_SCI_NONE;
     else if ( !strcmp(sci_type, "scmi_smc") )
+    {
+        if ( !IS_ENABLED(CONFIG_SCMI_SMC) )
+        {
+            printk(XENLOG_ERR "xen,sci_type=scmi_smc requested, but 
CONFIG_SCMI_SMC not set\n");
+            return -EINVAL;
+        }
+
         d_cfg->arch.arm_sci_type = XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_SMC;
+    }
     else
     {
         printk(XENLOG_ERR "xen,sci_type in not valid (%s) for domain %s\n",
diff --git a/xen/arch/arm/include/asm/firmware/sci.h 
b/xen/arch/arm/include/asm/firmware/sci.h
index 3500216bc250..485ce211c995 100644
--- a/xen/arch/arm/include/asm/firmware/sci.h
+++ b/xen/arch/arm/include/asm/firmware/sci.h
@@ -148,6 +148,8 @@ int sci_dt_finalize(struct domain *d, void *fdt);
 int sci_assign_dt_device(struct domain *d, struct dt_device_node *dev);
 #else
 
+#include <public/arch-arm.h>
+
 static inline bool sci_domain_is_enabled(struct domain *d)
 {
     return false;
@@ -162,6 +164,9 @@ static inline int sci_domain_init(struct domain *d,
 static inline int
 sci_domain_sanitise_config(struct xen_domctl_createdomain *config)
 {
+    if ( config->arch.arm_sci_type != XEN_DOMCTL_CONFIG_ARM_SCI_NONE )
+        return -EINVAL;
+
     return 0;
 }
 
-- 
2.43.0




 


Rackspace

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