From nobody Sun Sep 14 06:21:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1756995719; cv=pass; d=zohomail.com; s=zohoarc; b=WbIq53Ovcd52gH/vb2M+48vZyySsxB6+nmvv+K3uS4R3y/F2EnjJ+vxuKiaFYXVwGZMZg11wzELQVHEUZxbv76ZNDEEg1gpuhHaByy5oB/ILQvHP7nHt09gLiipjCT2qHhaWv56TarShn66sF+ImYpaMvjMSeB/wSbZ1e1J3sKg= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756995719; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vBrFjLRNqA0YEzCePfVWiUA4mMc43WHwaPUc0JP2ZXc=; b=Bvkg+5WGaGyr+0P7txBCuRLsGytFgm7ou3jY5nveoz2WGrQPoMSs0NK2nb8OdNFhOcmwJCTyAihG4wrpI18bVbaJtv9StX2DDTvK20ffRbz/ZPHNzv2BleTk0Ut36meDbPzVkH2RJb9gp45Ol+A1hz512oOZcTyAvWiDswIKysI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1756995718989469.6135466899841; Thu, 4 Sep 2025 07:21:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1110286.1459573 (Exim 4.92) (envelope-from ) id 1uuAqJ-0006Mn-8L; Thu, 04 Sep 2025 14:21:39 +0000 Received: by outflank-mailman (output) from mailman id 1110286.1459573; Thu, 04 Sep 2025 14:21:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uuAqJ-0006MY-48; Thu, 04 Sep 2025 14:21:39 +0000 Received: by outflank-mailman (input) for mailman id 1110286; Thu, 04 Sep 2025 14:21:37 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uuAqG-0005ts-Th for xen-devel@lists.xenproject.org; Thu, 04 Sep 2025 14:21:37 +0000 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazlp170110003.outbound.protection.outlook.com [2a01:111:f403:c201::3]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 760b2498-899a-11f0-9809-7dc792cee155; Thu, 04 Sep 2025 16:21:34 +0200 (CEST) Received: from DU0PR03MB8934.eurprd03.prod.outlook.com (2603:10a6:10:473::15) by GV2PR03MB8751.eurprd03.prod.outlook.com (2603:10a6:150:a8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.27; Thu, 4 Sep 2025 14:21:27 +0000 Received: from DU0PR03MB8934.eurprd03.prod.outlook.com ([fe80::26fd:98f2:a1cc:be40]) by DU0PR03MB8934.eurprd03.prod.outlook.com ([fe80::26fd:98f2:a1cc:be40%7]) with mapi id 15.20.9052.013; Thu, 4 Sep 2025 14:21:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 760b2498-899a-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=g1vx/7oJJ/owA78eDldT3gLToOv+Zm/JprMSh2uYIbyXSilBNOpcHuZUnLjl1ZGK8h2HmIJHCHbDdHVPGjhaP9HpzDzZh1q1LW4Jf+0Sz9KtDC34qUDz44jhFyxXUO1rq0UDBPUiGGhH+OqibQV9MRqVJejVFLSn34JIC2Kjlmujss1Li7yHHJWzxfB4VINSL9qSvRQekGkg4pYUDgTIcA0ghOjZ94PcmcxEuN/5JhAZ2f+sXYgHPXTX+gESxEb5vhwfiuQIHDQVdq5QgUlM+xFRHX8h2Om5o4HRW7hjzkzItrKTHEDxCle3wDpQgB/Rwh9gNppGApERE3zSEWom1w== 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=vBrFjLRNqA0YEzCePfVWiUA4mMc43WHwaPUc0JP2ZXc=; b=ruDlYz3nswZs9sBZc8BB7tr4Hbr9by5NJg7h4OiYw/HUP/ea06Jb2X9R+nzHnoAP3cz6ZQKmfnzRpj7pC2S3CwnePpSS4EikFHcGl9T5dSqmq+J05n5EFlMWiHd3gMhy9eOUn9D4cajcBH7NGInA+vjzUazdLDYxK/fFR1+eK4Q4yHvsY3XBRh1gJe1FS3NHDzRC1mw3UDeecHCjt93KiQYYf/sxld9EWb4uXWRn+8mKccZDXKqJM9PL810gJBMwSl9VD64rhLa+QMkhUuxM2ttoHZZq4iJX/8b7JAMcFcyUkJTWNrew6UTMkUj69rYQfa9SscnBbyP4D9rl7lAfmg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vBrFjLRNqA0YEzCePfVWiUA4mMc43WHwaPUc0JP2ZXc=; b=Q4lJwQxIAU/CsiQQHkFJ/oh4+IRCkutGsnUP4DszT2JZK77AK/uoPBUFXfvDyCENtE+xukeLRlYZZ6KI08RC/A28VLJi76G2Y6klYE6LGteSMzp97flcaTGHIs+7JqHb0AHosW0XuJYIFf7yRyrnu6YK7NfJsll4JkXlQCZ8ykYV7F61xSVa8IIC3ncuKHAu0z0RynlLIeUhqLg46NDlzXuQ9xhA2+5ts9wBrP1F4pxzIbEJqYnsOsamv4EqzxBfaCXVLxMOVfxoNTc19Hx3XAe8AO0o8tQJRi5JrrFAg59hpV2Rl5M5ZovB6zgSsn7ZgIp08DMbPiODpTRrGjUOxw== From: Oleksii Moisieiev To: "xen-devel@lists.xenproject.org" CC: Andrew Cooper , Anthony PERARD , Bertrand Marquis , Jan Beulich , Juergen Gross , Julien Grall , Michal Orzel , Oleksii Moisieiev , =?iso-8859-1?Q?Roger_Pau_Monn=E9?= , Stefano Stabellini , Volodymyr Babchuk , Grygorii Strashko Subject: [PATCH v9 1/4] xen/arm: add generic SCI subsystem Thread-Topic: [PATCH v9 1/4] xen/arm: add generic SCI subsystem Thread-Index: AQHcHaczp/pn2jKXU0i48m8PFCAwNA== Date: Thu, 4 Sep 2025 14:21:27 +0000 Message-ID: <3e237c5256054a88b1c099d85d8bd1a602bba230.1756995595.git.oleksii_moisieiev@epam.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU0PR03MB8934:EE_|GV2PR03MB8751:EE_ x-ms-office365-filtering-correlation-id: 3ea15c19-5fc1-4378-494a-08ddebbe560b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|7416014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?+gUOHSrlBig1bNQUdrA4QDhiQsB888urPrPiF5tJe94HrSJOlfwhUck6tf?= =?iso-8859-1?Q?9uDqfpYC4UqsBBVPANGj4N2RppfDTI7fNvegJzp2OZHxWNLpwmztGPekf8?= =?iso-8859-1?Q?ndhUaDwnCSRtQbXaR3E9XdsAm3HAb+rk2YwSErcPKokKKa59eX6QGqnB0o?= =?iso-8859-1?Q?FotM630W/toBokDx/MZMlNd9WK7idg14Nb8h4nnGgCl0v36/LmHPkYZlLg?= =?iso-8859-1?Q?lKmqZybB4k8hXgbuqa2QqFmHiCulFXxHSW5T6QLud6HPBFzVECrB3cQ8M5?= =?iso-8859-1?Q?wpam5SZ/HUm/BGIvppnoQKsMrY+LQ8oMRns8zWOb1SlXdhCIcLdolV12KT?= =?iso-8859-1?Q?pcqr1HlkyNuHFSsZv8iXMHQ+AInL5DaHSk3TumHJBuU6vHyno5YFc/ohIj?= =?iso-8859-1?Q?22tuBPT9zFxuTYIBewWrnCXSOm5mYr911Cvm39H7Ttxqm+A3HD5RaTE+m7?= =?iso-8859-1?Q?dfRNYE8EpolviwEDTyIbeoe/fHE6TR0fAfo7ngmtjgMG0b93vOr4o/LoNk?= =?iso-8859-1?Q?FnlI056Np4AbheAPdgKejKyb9GUcAGJRXuQgflwdaueUIEif5F6dTmQZsR?= =?iso-8859-1?Q?i6MsjG0nSaRsm1BcjHsQ7n683lhB0JS5SBBeYNbDWxgENwQzcA/K3zVFR2?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sRTC5bw3R69OKw=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR03MB8934.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?JUfyNbQjU1GAHZP5a0lMqAw6rH8fLz7iWM7zpk1kYpj2X3eq2FmdvMjL1D?= =?iso-8859-1?Q?G8SQHr5HwnUfLEKDWcyVStLwXrLSWXw4AFFUGlgTbAuHnz9rcjGhsci65P?= =?iso-8859-1?Q?z2/o8up36byjc/aW/XJyocQo7kYC//z34x+sYE+0HcMjwuii5eWREQVt4d?= =?iso-8859-1?Q?LS9e5P6lqe0/R1t5RPXGlRBsmIJyqgURYTILPLW6Vxzqo2UovldwIPdIZT?= =?iso-8859-1?Q?wHt4ZvLSzNPcZGG9n/nX4pbze6e5832r9rJn3zPy6dBqLtsYzAjtLKkjkD?= =?iso-8859-1?Q?6wqNioVAgPOS9GCpsvnnOcNWidwmYP+JAmV4tLpVuGHko2OVUDO2WYtRik?= =?iso-8859-1?Q?3y1Q5vSL1oan239syTAIKCPQ8fZY8LVNLECwzAVOTqleh33Y7lV5KiD+45?= =?iso-8859-1?Q?cFBzaZHx2ZC2J1qDg+8ek077N2qK+VKRbzkv3O1x+91XPsRRXrdNiFkUjn?= =?iso-8859-1?Q?qQCzg0LQTVWBNOvyCTjIJEp74ONCbHHP9JjlT6PlhbRXSTMjdLrw5xfNd/?= =?iso-8859-1?Q?iJoQvLr8Owu0hM0L4vDVzT/LHyynO7lH4m5iiE18Y+DLQ5m60vApImNDxQ?= =?iso-8859-1?Q?0mfogEp6aIXvF6fH2RmoHk8pjty+ogNLBOWWhi8TEuHIRb8sHq+whx38VV?= =?iso-8859-1?Q?0zyM9TA30NnNlgyU974n0d4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oWNxLSRHV8idOQVXSl4tyYvEtQubF8mq1Ay7QnQ0S5jUQEevKbgm8?= =?iso-8859-1?Q?mZIRfHewb3QLIk8jvXvNOmJmmQhJX5fs0pvW3ivKgDvHmUrtLVHoYPVQ?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU0PR03MB8934.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ea15c19-5fc1-4378-494a-08ddebbe560b X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Sep 2025 14:21:27.2395 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZzeoS0wSaXjo7kwRiIYSNa4xOqeBAQpuMxJqUWlm0t8cT01ZnQBH86LIMrLobrG5XzJcwWrGp9InHoq7PBCaPZYU/dV2OdgwNgSeWpaHWlM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8751 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1756995720793116600 Content-Type: text/plain; charset="utf-8" This patch adds the basic framework for ARM SCI mediator. SCI is System Control Interface, which is designed to redirect requests from the Domains to ARM specific Firmware (for example SCMI). This will allow the devices, passed-through to the different Domains, to access to the System resources (such as clocks/resets etc) by sending requests to the firmware. ARM SCI subsystem allows to implement different SCI drivers to handle specific ARM firmware interfaces (like ARM SCMI) and mediate requests -between the Domains and the Firmware. Also it allows SCI drivers to perform proper action during Domain creation/destruction which is vital for handling use cases like Domain reboot. This patch introduces new DEVICE_FIRMWARE device subclass for probing SCI drivers basing on device tree, SCI drivers register itself with DT_DEVICE_START/END macro. On init - the SCI drivers should register its SCI ops with sci_register(). Only one SCI driver can be supported. At run-time, the following SCI API calls are introduced: - sci_domain_sanitise_config() called from arch_sanitise_domain_config() - sci_domain_init() called from arch_domain_create() - sci_relinquish_resources() called from domain_relinquish_resources() - sci_domain_destroy() called from arch_domain_destroy() - sci_handle_call() called from vsmccc_handle_call() - sci_dt_handle_node() - sci_dt_finalize() called from handle_node() (Dom0 DT) Signed-off-by: Oleksii Moisieiev Signed-off-by: Grygorii Strashko Reviewed-by: Stefano Stabellini --- Changes in v9: - change input param name for sci_handle_call function to match MISRA rules Changes in v7: - fix sci_handl_call to make changes more readable - fix build error when DOM0LESS_BUILD is disabled (removed arch_handle_passthrough_prop from the header) - sort headers in alphabetical order in sci.h Changes in v6: - rebase on top of the latest master - fix return value of sci_dt_finalize() call Changes in v5: - update Maintainers file. Set role as a Reviewer - rebased on the latest master branch - Introduce arch_handle_passthrough_prop call to handle arm specific nodes Changes in v4: - fix SPDX-License - rename DEVICE_ARM_SCI DT device class to FIRMWARE_DEVICE - move XEN_DOMCTL_assign_device code in separate patch - Add documentation for SCI SCMI drivers MAINTAINERS | 6 + xen/arch/arm/device.c | 5 + xen/arch/arm/dom0less-build.c | 8 + xen/arch/arm/domain.c | 12 +- xen/arch/arm/domain_build.c | 8 + xen/arch/arm/firmware/Kconfig | 8 + xen/arch/arm/firmware/Makefile | 1 + xen/arch/arm/firmware/sci.c | 154 ++++++++++++++++++ xen/arch/arm/include/asm/domain.h | 5 + xen/arch/arm/include/asm/firmware/sci.h | 200 ++++++++++++++++++++++++ xen/arch/arm/vsmc.c | 3 +- xen/common/device-tree/dom0less-build.c | 4 + xen/include/asm-generic/device.h | 1 + xen/include/public/arch-arm.h | 4 + xen/include/xen/dom0less-build.h | 3 + 15 files changed, 420 insertions(+), 2 deletions(-) create mode 100644 xen/arch/arm/firmware/sci.c create mode 100644 xen/arch/arm/include/asm/firmware/sci.h diff --git a/MAINTAINERS b/MAINTAINERS index c4886c1159..31dbba54bb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -509,6 +509,12 @@ R: George Dunlap S: Supported F: xen/common/sched/ =20 +SCI MEDIATORS +R: Oleksii Moisieiev +S: Supported +F: xen/arch/arm/firmware/sci.c +F: xen/arch/arm/include/asm/firmware/sci.h + SEABIOS UPSTREAM M: Wei Liu S: Supported diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c index 11523750ae..74b54cad34 100644 --- a/xen/arch/arm/device.c +++ b/xen/arch/arm/device.c @@ -13,6 +13,7 @@ #include #include =20 +#include #include =20 int map_irq_to_domain(struct domain *d, unsigned int irq, @@ -303,6 +304,10 @@ int handle_device(struct domain *d, struct dt_device_n= ode *dev, p2m_type_t p2mt, return res; } } + + res =3D sci_assign_dt_device(d, dev); + if ( res ) + return res; } =20 res =3D map_device_irqs_to_domain(d, dev, own_device, irq_ranges); diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c index c8d07213e2..0094cf9e40 100644 --- a/xen/arch/arm/dom0less-build.c +++ b/xen/arch/arm/dom0less-build.c @@ -22,6 +22,7 @@ =20 #include #include +#include #include #include =20 @@ -272,6 +273,12 @@ int __init init_vuart(struct domain *d, struct kernel_= info *kinfo, return rc; } =20 +int __init arch_handle_passthrough_prop(struct kernel_info *kinfo, + struct dt_device_node *node) +{ + return sci_assign_dt_device(kinfo->bd.d, node); +} + int __init arch_parse_dom0less_node(struct dt_device_node *node, struct boot_domain *bd) { @@ -281,6 +288,7 @@ int __init arch_parse_dom0less_node(struct dt_device_no= de *node, =20 d_cfg->arch.gic_version =3D XEN_DOMCTL_CONFIG_GIC_NATIVE; d_cfg->flags |=3D XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap; + d_cfg->arch.arm_sci_type =3D XEN_DOMCTL_CONFIG_ARM_SCI_NONE; =20 if ( !dt_property_read_u32(node, "nr_spis", &d_cfg->arch.nr_spis) ) { diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 863ae18157..1a8585d02b 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -699,7 +700,7 @@ int arch_sanitise_domain_config(struct xen_domctl_creat= edomain *config) return -EINVAL; } =20 - return 0; + return sci_domain_sanitise_config(config); } =20 int arch_domain_create(struct domain *d, @@ -791,6 +792,9 @@ int arch_domain_create(struct domain *d, d->arch.sve_vl =3D config->arch.sve_vl; #endif =20 + if ( (rc =3D sci_domain_init(d, config)) !=3D 0 ) + goto fail; + return 0; =20 fail: @@ -851,6 +855,7 @@ void arch_domain_destroy(struct domain *d) domain_vgic_free(d); domain_vuart_free(d); free_xenheap_page(d->shared_info); + sci_domain_destroy(d); #ifdef CONFIG_ACPI free_xenheap_pages(d->arch.efi_acpi_table, get_order_from_bytes(d->arch.efi_acpi_len)); @@ -1044,6 +1049,7 @@ enum { PROG_p2m_root, PROG_p2m, PROG_p2m_pool, + PROG_sci, PROG_done, }; =20 @@ -1103,6 +1109,10 @@ int domain_relinquish_resources(struct domain *d) ret =3D relinquish_p2m_mapping(d); if ( ret ) return ret; + PROGRESS(sci): + ret =3D sci_relinquish_resources(d); + if ( ret ) + return ret; =20 PROGRESS(p2m_root): /* diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index a9e4153e3c..039aa71439 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -1640,6 +1641,9 @@ static int __init handle_node(struct domain *d, struc= t kernel_info *kinfo, return 0; } =20 + if ( sci_dt_handle_node(d, node) ) + return 0; + /* * The vGIC does not support routing hardware PPIs to guest. So * we need to skip any node using PPIs. @@ -1740,6 +1744,10 @@ static int __init handle_node(struct domain *d, stru= ct kernel_info *kinfo, if ( res ) return res; =20 + res =3D sci_dt_finalize(d, kinfo->fdt); + if ( res ) + return res; + /* * Create a second memory node to store the ranges covering * reserved-memory regions. diff --git a/xen/arch/arm/firmware/Kconfig b/xen/arch/arm/firmware/Kconfig index 817da745fd..fc7918c7fc 100644 --- a/xen/arch/arm/firmware/Kconfig +++ b/xen/arch/arm/firmware/Kconfig @@ -1,3 +1,11 @@ +config ARM_SCI + bool + depends on ARM + help + This option enables generic Arm SCI (System Control Interface) mediators + support. It allows domains to control system resources via one of + Arm SCI mediators drivers implemented in XEN, like SCMI. + menu "Firmware Drivers" =20 config SCMI_SMC diff --git a/xen/arch/arm/firmware/Makefile b/xen/arch/arm/firmware/Makefile index a5e4542666..71bdefc24a 100644 --- a/xen/arch/arm/firmware/Makefile +++ b/xen/arch/arm/firmware/Makefile @@ -1 +1,2 @@ +obj-$(CONFIG_ARM_SCI) +=3D sci.o obj-$(CONFIG_SCMI_SMC) +=3D scmi-smc.o diff --git a/xen/arch/arm/firmware/sci.c b/xen/arch/arm/firmware/sci.c new file mode 100644 index 0000000000..aa93cda7f0 --- /dev/null +++ b/xen/arch/arm/firmware/sci.c @@ -0,0 +1,154 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Generic part of the SCI (System Control Interface) subsystem. + * + * Oleksii Moisieiev + * Copyright (c) 2025 EPAM Systems + */ + +#include +#include +#include +#include +#include + +#include + +static const struct sci_mediator_ops __read_mostly *cur_mediator; + +int sci_register(const struct sci_mediator_ops *ops) +{ + if ( cur_mediator ) + return -EEXIST; + + if ( !ops->domain_init || !ops->domain_destroy || !ops->handle_call ) + return -EINVAL; + + cur_mediator =3D ops; + + return 0; +}; + +bool sci_handle_call(struct cpu_user_regs *regs) +{ + if ( unlikely(!cur_mediator) ) + return false; + + return cur_mediator->handle_call(regs); +} + +int sci_domain_init(struct domain *d, struct xen_domctl_createdomain *conf= ig) +{ + if ( !cur_mediator ) + return 0; + + return cur_mediator->domain_init(d, config); +} + +int sci_domain_sanitise_config(struct xen_domctl_createdomain *config) +{ + if ( !cur_mediator ) + return 0; + + if ( !cur_mediator->domain_sanitise_config ) + return 0; + + return cur_mediator->domain_sanitise_config(config); +} + +void sci_domain_destroy(struct domain *d) +{ + if ( !cur_mediator ) + return; + + cur_mediator->domain_destroy(d); +} + +int sci_relinquish_resources(struct domain *d) +{ + if ( !cur_mediator ) + return 0; + + if ( !cur_mediator->relinquish_resources ) + return 0; + + return cur_mediator->relinquish_resources(d); +} + +bool sci_dt_handle_node(struct domain *d, struct dt_device_node *node) +{ + if ( !cur_mediator ) + return 0; + + if ( !cur_mediator->dom0_dt_handle_node ) + return 0; + + return cur_mediator->dom0_dt_handle_node(d, node); +} + +int sci_dt_finalize(struct domain *d, void *fdt) +{ + if ( !cur_mediator ) + return 0; + + if ( !cur_mediator->dom0_dt_finalize ) + return 0; + + return cur_mediator->dom0_dt_finalize(d, fdt); +} + +int sci_assign_dt_device(struct domain *d, struct dt_device_node *dev) +{ + struct dt_phandle_args ac_spec; + int index =3D 0; + int ret; + + if ( !cur_mediator ) + return 0; + + if ( !cur_mediator->assign_dt_device ) + return 0; + + while ( !dt_parse_phandle_with_args(dev, "access-controllers", + "#access-controller-cells", index, + &ac_spec) ) + { + printk(XENLOG_DEBUG "sci: assign device %s to %pd\n", + dt_node_full_name(dev), d); + + ret =3D cur_mediator->assign_dt_device(d, &ac_spec); + if ( ret ) + return ret; + + index++; + } + + return 0; +} + +static int __init sci_init(void) +{ + struct dt_device_node *np; + unsigned int num_sci =3D 0; + int rc; + + dt_for_each_device_node(dt_host, np) + { + rc =3D device_init(np, DEVICE_FIRMWARE, NULL); + if ( !rc && num_sci ) + { + printk(XENLOG_ERR + "SCMI: Only one SCI controller is supported. found seco= nd %s\n", + np->name); + return -EOPNOTSUPP; + } + else if ( !rc ) + num_sci++; + else if ( rc !=3D -EBADF && rc !=3D -ENODEV ) + return rc; + } + + return 0; +} + +__initcall(sci_init); diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/d= omain.h index a3487ca713..af3e168374 100644 --- a/xen/arch/arm/include/asm/domain.h +++ b/xen/arch/arm/include/asm/domain.h @@ -120,6 +120,11 @@ struct arch_domain #ifdef CONFIG_TEE void *tee; #endif +#ifdef CONFIG_ARM_SCI + bool sci_enabled; + /* ARM SCI driver's specific data */ + void *sci_data; +#endif =20 } __cacheline_aligned; =20 diff --git a/xen/arch/arm/include/asm/firmware/sci.h b/xen/arch/arm/include= /asm/firmware/sci.h new file mode 100644 index 0000000000..3500216bc2 --- /dev/null +++ b/xen/arch/arm/include/asm/firmware/sci.h @@ -0,0 +1,200 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Generic ARM SCI (System Control Interface) subsystem. + * + * Oleksii Moisieiev + * Copyright (c) 2025 EPAM Systems + */ + +#ifndef __ASM_ARM_SCI_H +#define __ASM_ARM_SCI_H + +#include +#include +#include +#include +#include + +#ifdef CONFIG_ARM_SCI + +struct sci_mediator_ops { + /* + * Called during domain construction. If it is requested to enable + * SCI support, so SCI driver can create own structures for the new do= main + * and inform firmware about new domain (if required). + * Mandatory. + */ + int (*domain_init)(struct domain *d, + struct xen_domctl_createdomain *config); + + /* + * Called during domain construction. The SCI driver uses + * it to sanitize domain SCI configuration parameters. + * Optional. + */ + int (*domain_sanitise_config)(struct xen_domctl_createdomain *config); + + /* + * Called during domain destruction, releases all resources, that + * were allocated for domain. + * Mandatory. + */ + void (*domain_destroy)(struct domain *d); + + /* + * Called during domain destruction to relinquish resources used + * by SCI driver itself and request resources releasing from firmware. + * Optional. + */ + int (*relinquish_resources)(struct domain *d); + + /* SMC/HVC Handle callback */ + bool (*handle_call)(struct cpu_user_regs *regs); + + /* + * Dom0 DT nodes handling callback so SCI driver can detect DT nodes it + * need to handle and decide if those nodes need to be provided to Dom= 0. + * Optional. + */ + bool (*dom0_dt_handle_node)(struct domain *d, struct dt_device_node *n= ode); + + /* + * SCI driver callback called at the end of Dom0 DT generation, so + * it can perform steps to modify DT to enable/disable SCI + * functionality for Dom0. + */ + int (*dom0_dt_finalize)(struct domain *d, void *fdt); + + /* + * SCI driver callback called when DT device is passed through to gues= t, + * so SCI driver can enable device access to the domain if SCI FW prov= ides + * Device specific access control functionality. + * Optional. + */ + int (*assign_dt_device)(struct domain *d, struct dt_phandle_args *ac_s= pec); +}; + + +static inline bool sci_domain_is_enabled(struct domain *d) +{ + return d->arch.sci_enabled; +} + +/* + * Register SCI subsystem ops. + * + * Register SCI drivers operation and so enable SCI functionality. + * Only one SCI driver is supported. + */ +int sci_register(const struct sci_mediator_ops *ops); + +/* + * Initialize SCI functionality for domain if configured. + * + * Initialization routine to enable SCI functionality for the domain. + * The SCI configuration data and decision about enabling SCI functionality + * for the domain is SCI driver specific. + */ +int sci_domain_init(struct domain *d, struct xen_domctl_createdomain *conf= ig); + +/* + * Sanitise domain configuration parameters. + * + */ +int sci_domain_sanitise_config(struct xen_domctl_createdomain *config); + +/* + * Destroy SCI domain instance. + */ +void sci_domain_destroy(struct domain *d); + +/* + * Free resources assigned to the certain domain. + */ +int sci_relinquish_resources(struct domain *d); + +/* + * SMC/HVC Handle callback. + * + * SCI driver acts as SMC/HVC server for the registered domains and + * does redirection of the domain calls to the SCI firmware, + * such as ARM TF-A or similar. + */ +bool sci_handle_call(struct cpu_user_regs *regs); + +/* + * Dom0 DT nodes handling function. + * + * Allows SCI driver to detect DT nodes it need to handle and decide if + * those nodes need to be provided to Dom0. + */ +bool sci_dt_handle_node(struct domain *d, struct dt_device_node *node); + +/* + * Dom0 DT generation finalize. + * + * Called at the end of Dom0 DT generation, so SCI driver can perform steps + * to modify DT to enable/disable SCI functionality for Dom0. + */ +int sci_dt_finalize(struct domain *d, void *fdt); + +/* + * Assign DT device to domain. + * + * Called when DT device is passed through to guest, so SCI driver can ena= ble + * device access to the domain if SCI FW provides "Device specific access + * control" functionality. + */ +int sci_assign_dt_device(struct domain *d, struct dt_device_node *dev); +#else + +static inline bool sci_domain_is_enabled(struct domain *d) +{ + return false; +} + +static inline int sci_domain_init(struct domain *d, + struct xen_domctl_createdomain *config) +{ + return 0; +} + +static inline int +sci_domain_sanitise_config(struct xen_domctl_createdomain *config) +{ + return 0; +} + +static inline void sci_domain_destroy(struct domain *d) +{} + +static inline int sci_relinquish_resources(struct domain *d) +{ + return 0; +} + +static inline bool sci_handle_call(struct cpu_user_regs *regs) +{ + return false; +} + +static inline bool sci_dt_handle_node(struct domain *d, + struct dt_device_node *node) +{ + return false; +} + +static inline int sci_dt_finalize(struct domain *d, void *fdt) +{ + return 0; +} + +static inline int sci_assign_dt_device(struct domain *d, + struct dt_device_node *dev) +{ + return 0; +} + +#endif /* CONFIG_ARM_SCI */ + +#endif /* __ASM_ARM_SCI_H */ diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c index 6081f14ed0..4095171533 100644 --- a/xen/arch/arm/vsmc.c +++ b/xen/arch/arm/vsmc.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -232,7 +233,7 @@ static bool handle_sip(struct cpu_user_regs *regs) if ( platform_smc(regs) ) return true; =20 - return scmi_handle_smc(regs); + return (scmi_handle_smc(regs)) ? true : sci_handle_call(regs); } =20 /* diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr= ee/dom0less-build.c index badc227031..aaa5e9b22c 100644 --- a/xen/common/device-tree/dom0less-build.c +++ b/xen/common/device-tree/dom0less-build.c @@ -228,6 +228,10 @@ static int __init handle_passthrough_prop(struct kerne= l_info *kinfo, if ( res < 0 ) return res; =20 + res =3D arch_handle_passthrough_prop(kinfo, node); + if ( res ) + return res; + /* If xen_force, we allow assignment of devices without IOMMU protecti= on. */ if ( xen_force && !dt_device_is_protected(node) ) return 0; diff --git a/xen/include/asm-generic/device.h b/xen/include/asm-generic/dev= ice.h index 3bd97e33c5..cb13f7faea 100644 --- a/xen/include/asm-generic/device.h +++ b/xen/include/asm-generic/device.h @@ -18,6 +18,7 @@ enum device_class DEVICE_IOMMU, DEVICE_INTERRUPT_CONTROLLER, DEVICE_PCI_HOSTBRIDGE, + DEVICE_FIRMWARE, /* Use for error */ DEVICE_UNKNOWN, }; diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index e2412a1747..e7a17ede3e 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -327,6 +327,8 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t); #define XEN_DOMCTL_CONFIG_TEE_OPTEE 1 #define XEN_DOMCTL_CONFIG_TEE_FFA 2 =20 +#define XEN_DOMCTL_CONFIG_ARM_SCI_NONE 0 + struct xen_arch_domainconfig { /* IN/OUT */ uint8_t gic_version; @@ -350,6 +352,8 @@ struct xen_arch_domainconfig { * */ uint32_t clock_frequency; + /* IN */ + uint8_t arm_sci_type; }; #endif /* __XEN__ || __XEN_TOOLS__ */ =20 diff --git a/xen/include/xen/dom0less-build.h b/xen/include/xen/dom0less-bu= ild.h index 408859e325..faaf660424 100644 --- a/xen/include/xen/dom0less-build.h +++ b/xen/include/xen/dom0less-build.h @@ -62,6 +62,9 @@ void set_domain_type(struct domain *d, struct kernel_info= *kinfo); int init_intc_phandle(struct kernel_info *kinfo, const char *name, const int node_next, const void *pfdt); =20 +int arch_handle_passthrough_prop(struct kernel_info *kinfo, + struct dt_device_node *node); + #else /* !CONFIG_DOM0LESS_BOOT */ =20 static inline void create_domUs(void) {} --=20 2.34.1 From nobody Sun Sep 14 06:21:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1756995723; cv=pass; d=zohomail.com; s=zohoarc; b=anOZxoKCBci39x5nqhbnJa1dw2P1mBEdBaB3hBoJNce4OX1EiGCTQRbj0LNfASAg88h1LPQOydGYrFAe4qfiJLF942mbPa5eDuAcJpF2Kypb2cLQS+QHSTGHySbdwIAPpJg9VxXfL5h3qhuqhBwHKT77GproPMWdXoQYl7LvZHI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756995723; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qLqKtUXnnhvD9/L7FKSmlG8ST1SlgHYQ55gQP5fFKiI=; b=Fntkm/0agmmEKHVoxIvfyeuwXzkUuTyQkwcTZ/AtRc5PtrvMPx6z+3xHBSCG2rrowPWxxTtVRphJS7/FIPf7zUc8TJsPSfdOiFPGVwVeQRZboQTAmQE1qjNENytOXVPXwmndX5svKEyeQinKGCwEMyPVxA//z1PaVRjCa//GpuA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1756995723405519.4069900914529; Thu, 4 Sep 2025 07:22:03 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1110287.1459583 (Exim 4.92) (envelope-from ) id 1uuAqK-0006bg-IP; Thu, 04 Sep 2025 14:21:40 +0000 Received: by outflank-mailman (output) from mailman id 1110287.1459583; Thu, 04 Sep 2025 14:21:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uuAqK-0006bV-Ea; Thu, 04 Sep 2025 14:21:40 +0000 Received: by outflank-mailman (input) for mailman id 1110287; Thu, 04 Sep 2025 14:21:38 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uuAqI-0005ts-MZ for xen-devel@lists.xenproject.org; Thu, 04 Sep 2025 14:21:38 +0000 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazlp170110003.outbound.protection.outlook.com [2a01:111:f403:c201::3]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 77580edf-899a-11f0-9809-7dc792cee155; Thu, 04 Sep 2025 16:21:36 +0200 (CEST) Received: from DU0PR03MB8934.eurprd03.prod.outlook.com (2603:10a6:10:473::15) by GV2PR03MB8751.eurprd03.prod.outlook.com (2603:10a6:150:a8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.27; Thu, 4 Sep 2025 14:21:28 +0000 Received: from DU0PR03MB8934.eurprd03.prod.outlook.com ([fe80::26fd:98f2:a1cc:be40]) by DU0PR03MB8934.eurprd03.prod.outlook.com ([fe80::26fd:98f2:a1cc:be40%7]) with mapi id 15.20.9052.013; Thu, 4 Sep 2025 14:21:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 77580edf-899a-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xjnJOz4kzjyGz+9hbMnanO9ye/Jl4hoWy6YrxVOwwZLSTqubUmo4AYhBMix0Q+DiQ/OuNIVSynA4Foj9IutlUF3L4tpmzWj2TN5HConArzfmz9kdb/q0u56xjiP3Iiuj3MrNfCFEmsAE2yUKH1h3T/vwvol4gUBSSj9iZH54I8xJy2io8ndi7wrkR0ZxYwD/Rai+WKPVQpEH9BNsFMmpl4obqPJpdmQ3Hn/lk+N2UF4Ssoz3HoI0hTbhOamfZC2O4gjJZACgNzHIFGAxLRVm7WjLc+a8GhfculakbuWPJnGasjZProuEZC16Rc/n4/kn3zVrwrXq6O1WvQD2IkXnMA== 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=qLqKtUXnnhvD9/L7FKSmlG8ST1SlgHYQ55gQP5fFKiI=; b=XC78V7Z6Xl/1MxR6uMvWQXsHvpitVY9lE7oS9s6l1kOQplocxXGqhR6JaV/KqnjAVKdNt0TLDw9x8uLDXDUixkqmJYcGTVFllydcWt570IHeAFk/dePGBYWVsJHFOCTFte5/Yiqu9sYLi0Iv7MzDYgKeswq7Fm4dG0r+tgmSesIBUvxd9pdIIlfMT1QZW04L2ZAjlRdKfKHEwI5BUhpy2/E+J9+5UZzZWtMPkFbVeTJG36G+F4i0O612LEol56sFQLrlQA4Vst+D+5+ggXhfVi21KHncs3wQL5haMOPq6QJQoL5TIzuEuaseEPsP+M3P0F1KtevONOJXC8M29LjuOA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qLqKtUXnnhvD9/L7FKSmlG8ST1SlgHYQ55gQP5fFKiI=; b=Gh/KkS1EiboPbLxMXtIf7t65408TR9Z4Sltqy4NSrMzMQ+Eks73+jWroTar+r42BBzwO/7tcx2AfeuGhzCZhZbWTh2juvbNzzXy1vsgdaSNC2O7x8t+OC/Fah6TE5ZFGMEQ/wS9qgvri2/p0o9YMHdNHuNBf+F4eiGSKdBNezyy28Qi/MC5GFcseHtB3yo4lQ/DuCXs3tH/EB3OiHob6eo9aPCeYjtHHjEExZZ1sA5R8vwZXUgU2IU6s5UJcXhOUQqZ03dzCshgAMOYZgoAAH6+6yZihQzP/xAdAqIYhbbWOOdvcsTMbhjMTaiiPkchCoG8q2JyPelRYeeJkThuA8w== From: Oleksii Moisieiev To: "xen-devel@lists.xenproject.org" CC: Andrew Cooper , Anthony PERARD , Bertrand Marquis , Jan Beulich , Juergen Gross , Julien Grall , Michal Orzel , Oleksii Moisieiev , =?iso-8859-1?Q?Roger_Pau_Monn=E9?= , Stefano Stabellini , Volodymyr Babchuk , Grygorii Strashko Subject: [PATCH v9 2/4] xen/arm: scmi-smc: update to be used under sci subsystem Thread-Topic: [PATCH v9 2/4] xen/arm: scmi-smc: update to be used under sci subsystem Thread-Index: AQHcHaczwiXWETSGtUC3f6Sg3ujscw== Date: Thu, 4 Sep 2025 14:21:27 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU0PR03MB8934:EE_|GV2PR03MB8751:EE_ x-ms-office365-filtering-correlation-id: a00457a0-5939-4a70-17a7-08ddebbe563d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|7416014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?ArRqZYeNxee8ki1fQ76xsDP/X3cBNIFySWT9k1DDprrQg/yb94VQVFa+z0?= =?iso-8859-1?Q?+sO24Eok+ZfxHh0Cn9q0sMuat4DSJngaRa28Uz9uXOubBzyBwL4ZGlH+3G?= =?iso-8859-1?Q?BrJZ0dbjJCDN2GURukQjSnmiZMXcdgld6p5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RygHDMQWhhmygJGMt0vCxk9WFS+cQOCXmEWRIT7?= =?iso-8859-1?Q?gHk+zGfGQJ6Ceoqa3Bj77OvjuHF+a3QPUiEKL00UhShp6H6u6BqmHvJpA9?= =?iso-8859-1?Q?rxAhXeTohqW9tmZUeBQyKyYxZbM7hdgckl/FTVJ4wLaTSbKk+ue39CxwsL?= =?iso-8859-1?Q?+4aYq9PSmUZbyXw3HW944E5COhuTru5bO/Q3a+UjhYH9wMRu3RQtk7EiAV?= =?iso-8859-1?Q?nsL6iV1aSi8A9oS/619qBuPndYNPDFAa8RxCekIvFlRN3yyjkfmAxCEnxm?= =?iso-8859-1?Q?lgxD3GCOKgLILbVeF9sVzHqPmyQ7VqJLxOWaSIY5RaR+XIwHqh+VbyGLwJ?= =?iso-8859-1?Q?g0SYfuStSq2AS6l7kSp7nBmLF2onm9Be2L0LUPflDvlpV9+cToiBg+OyTw?= =?iso-8859-1?Q?lV7MVnhuyEqCGuC9Ihl8JhkjWm3HJNaRin8tZV8Vu1ssf/TSfXUcL+YwyQ?= =?iso-8859-1?Q?T6CJRx4GMvUgf0oF1p3y74ZQ2Cs8F4nun+TZ08A3jrGw=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR03MB8934.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?7tmWfT43VPUzIYxRme6lD93HSrE7p8jyQYSBFwI5o4wmiX/rlRxS9aBzuS?= =?iso-8859-1?Q?k81b06Y7gIs5RYPkY+fx7PqLuSlr7b7tlPtTZcpkn+HRHhKvHlH6S+JaPj?= =?iso-8859-1?Q?Cw14ooKccAZkqS5GIr/p73ocnIQSyOnnoPFj5vEWHaxO+ijBqa35d1mLjh?= =?iso-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LvgYr0C8nHVBE8zmEt/yBQ0o?= =?iso-8859-1?Q?oG6zH7aVLZsQsBjhTUCCch+MxV+2EljKj5wtDEM64gIdilvKmFd/Y3hQC9?= =?iso-8859-1?Q?WcID00E7oLKH8MX9Q25+NTv1CfYQr7jfLjFBl/bpXWrmhLuD1DBQCRMoE9?= =?iso-8859-1?Q?yO4ZZLAt9CLOLNQkkeRYfvXpZGM2722yIR90UC+/6nTBmUHPPzE9heACIb?= =?iso-8859-1?Q?e5Px9qEHvwSlbCQigl4DIYTJgGsRej/ujXWcHdRe1PUX9pkxEXqaNcYzHn?= =?iso-8859-1?Q?PmUlWsxNm//Q4Ln86FxnlXdD6c3Fc9KSPt8ecmB8mOxG1nKNRXJhZL+eog?= =?iso-8859-1?Q?o8jpolhm26CRmb4pWcjBNPt+fte9TuJ2DOMEQ6LMgqWfyNzOljblMwb4Wg?= =?iso-8859-1?Q?McFp21tOC0JFjvcYAbBFcv/NkaTsxv0aBNs3KrczPSC6pwc2kz9JOHRFGm?= =?iso-8859-1?Q?ueldGPNUXEAo6U5v0gA7wESytwGiFL13wD8AUyslFw7pMoTpsM2g7RKtuU?= =?iso-8859-1?Q?UJ8au3+LV4CMyjeWqctopdypgH3RyHOMFCtRJukYY3tfzG+cBm1Eva4Ics?= =?iso-8859-1?Q?sNWXaQ24C/sbYhOYyEq1Qnan5/Fee/RrEw6EIqzuPXfXxcQ/NkAh7Sjw?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU0PR03MB8934.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a00457a0-5939-4a70-17a7-08ddebbe563d X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Sep 2025 14:21:27.5197 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 3992foHw6gz3wsQr2lV0uXTFZ8Nc6oF/rcoZx4Q8FP+hhRfszUo5SRRA1P36qHBeDHtPSnTT+iOOvHtwWGWoHmKw7C3Wn8aynDIyoWczmdU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8751 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1756995724713116600 Content-Type: text/plain; charset="utf-8" From: Grygorii Strashko The introduced SCI (System Control Interface) subsystem provides unified interface to integrate in Xen SCI drivers which adds support for ARM firmware (EL3, SCP) based software interfaces (like SCMI) that are used in system management. The SCI subsystem allows to add drivers for different FW interfaces or have different drivers for the same FW interface (for example, SCMI with different transports). This patch updates SCMI over SMC calls handling layer, introduced by commit 3e322bef8bc0 ("xen/arm: firmware: Add SCMI over SMC calls handling layer"), to be SCI driver: - convert to DT device; - convert to SCI Xen interface. There are no functional changes in general, the driver is just adopted to the SCI interface. Signed-off-by: Grygorii Strashko Reviewed-by: Stefano Stabellini --- (no changes since v7) Changes in v7: - sort headers in scmi-smc.c file Changes in v6: - add R-b tag xen/arch/arm/firmware/Kconfig | 13 ++- xen/arch/arm/firmware/scmi-smc.c | 93 +++++++++++--------- xen/arch/arm/include/asm/firmware/scmi-smc.h | 41 --------- xen/arch/arm/vsmc.c | 3 +- xen/include/public/arch-arm.h | 1 + 5 files changed, 64 insertions(+), 87 deletions(-) delete mode 100644 xen/arch/arm/include/asm/firmware/scmi-smc.h diff --git a/xen/arch/arm/firmware/Kconfig b/xen/arch/arm/firmware/Kconfig index fc7918c7fc..bbf88fbb9a 100644 --- a/xen/arch/arm/firmware/Kconfig +++ b/xen/arch/arm/firmware/Kconfig @@ -8,9 +8,18 @@ config ARM_SCI =20 menu "Firmware Drivers" =20 +choice + prompt "ARM SCI driver type" + default SCMI_SMC + help + Choose which ARM SCI driver to enable. + +config ARM_SCI_NONE + bool "none" + config SCMI_SMC bool "Forward SCMI over SMC calls from hwdom to EL3 firmware" - default y + select ARM_SCI help This option enables basic awareness for SCMI calls using SMC as doorbell mechanism and Shared Memory for transport ("arm,scmi-smc" @@ -18,4 +27,6 @@ config SCMI_SMC firmware node is used to trap and forward corresponding SCMI SMCs to firmware running at EL3, for calls coming from the hardware domain. =20 +endchoice + endmenu diff --git a/xen/arch/arm/firmware/scmi-smc.c b/xen/arch/arm/firmware/scmi-= smc.c index 33473c04b1..4c5df714c2 100644 --- a/xen/arch/arm/firmware/scmi-smc.c +++ b/xen/arch/arm/firmware/scmi-smc.c @@ -16,12 +16,12 @@ #include #include =20 +#include +#include #include -#include =20 #define SCMI_SMC_ID_PROP "arm,smc-id" =20 -static bool __ro_after_init scmi_enabled; static uint32_t __ro_after_init scmi_smc_id; =20 /* @@ -41,14 +41,11 @@ static bool scmi_is_valid_smc_id(uint32_t fid) * * Returns true if SMC was handled (regardless of response), false otherwi= se. */ -bool scmi_handle_smc(struct cpu_user_regs *regs) +static bool scmi_handle_smc(struct cpu_user_regs *regs) { uint32_t fid =3D (uint32_t)get_user_reg(regs, 0); struct arm_smccc_res res; =20 - if ( !scmi_enabled ) - return false; - if ( !scmi_is_valid_smc_id(fid) ) return false; =20 @@ -78,49 +75,45 @@ bool scmi_handle_smc(struct cpu_user_regs *regs) return true; } =20 -static int __init scmi_check_smccc_ver(void) +static int scmi_smc_domain_init(struct domain *d, + struct xen_domctl_createdomain *config) { - if ( smccc_ver < ARM_SMCCC_VERSION_1_1 ) - { - printk(XENLOG_WARNING - "SCMI: No SMCCC 1.1 support, SCMI calls forwarding disabled= \n"); - return -ENOSYS; - } + if ( !is_hardware_domain(d) ) + return 0; =20 + d->arch.sci_enabled =3D true; + printk(XENLOG_DEBUG "SCMI: %pd init\n", d); return 0; } =20 -static int __init scmi_dt_init_smccc(void) +static void scmi_smc_domain_destroy(struct domain *d) { - static const struct dt_device_match scmi_ids[] __initconst =3D - { - /* We only support "arm,scmi-smc" binding for now */ - DT_MATCH_COMPATIBLE("arm,scmi-smc"), - { /* sentinel */ }, - }; - const struct dt_device_node *scmi_node; - int ret; + if ( !is_hardware_domain(d) ) + return; =20 - /* If no SCMI firmware node found, fail silently as it's not mandatory= */ - scmi_node =3D dt_find_matching_node(NULL, scmi_ids); - if ( !scmi_node ) - return -EOPNOTSUPP; + printk(XENLOG_DEBUG "SCMI: %pd destroy\n", d); +} =20 - ret =3D dt_property_read_u32(scmi_node, SCMI_SMC_ID_PROP, &scmi_smc_id= ); - if ( !ret ) +static int __init scmi_check_smccc_ver(void) +{ + if ( smccc_ver < ARM_SMCCC_VERSION_1_1 ) { - printk(XENLOG_ERR "SCMI: No valid \"%s\" property in \"%s\" DT nod= e\n", - SCMI_SMC_ID_PROP, scmi_node->full_name); - return -ENOENT; + printk(XENLOG_WARNING + "SCMI: No SMCCC 1.1 support, SCMI calls forwarding disabled= \n"); + return -ENOSYS; } =20 - scmi_enabled =3D true; - return 0; } =20 +static const struct sci_mediator_ops scmi_smc_ops =3D { + .handle_call =3D scmi_handle_smc, + .domain_init =3D scmi_smc_domain_init, + .domain_destroy =3D scmi_smc_domain_destroy, +}; + /* Initialize the SCMI layer based on SMCs and Device-tree */ -static int __init scmi_init(void) +static int __init scmi_dom0_init(struct dt_device_node *dev, const void *d= ata) { int ret; =20 @@ -134,22 +127,36 @@ static int __init scmi_init(void) if ( ret ) return ret; =20 - ret =3D scmi_dt_init_smccc(); - if ( ret =3D=3D -EOPNOTSUPP ) - return ret; + ret =3D dt_property_read_u32(dev, SCMI_SMC_ID_PROP, &scmi_smc_id); + if ( !ret ) + { + printk(XENLOG_ERR "SCMI: No valid \"%s\" property in \"%s\" DT nod= e\n", + SCMI_SMC_ID_PROP, dt_node_full_name(dev)); + return -ENOENT; + } + + ret =3D sci_register(&scmi_smc_ops); if ( ret ) - goto err; + { + printk(XENLOG_ERR "SCMI: mediator already registered (ret =3D %d)\= n", + ret); + return ret; + } =20 printk(XENLOG_INFO "Using SCMI with SMC ID: 0x%x\n", scmi_smc_id); =20 return 0; - - err: - printk(XENLOG_ERR "SCMI: Initialization failed (ret =3D %d)\n", ret); - return ret; } =20 -__initcall(scmi_init); +static const struct dt_device_match scmi_smc_match[] __initconst =3D { + DT_MATCH_COMPATIBLE("arm,scmi-smc"), + { /* sentinel */ }, +}; + +DT_DEVICE_START(scmi_smc, "SCMI SMC DOM0", DEVICE_FIRMWARE) + .dt_match =3D scmi_smc_match, + .init =3D scmi_dom0_init, +DT_DEVICE_END =20 /* * Local variables: diff --git a/xen/arch/arm/include/asm/firmware/scmi-smc.h b/xen/arch/arm/in= clude/asm/firmware/scmi-smc.h deleted file mode 100644 index 6b1a164a40..0000000000 --- a/xen/arch/arm/include/asm/firmware/scmi-smc.h +++ /dev/null @@ -1,41 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * xen/arch/arm/include/asm/firmware/scmi-smc.h - * - * ARM System Control and Management Interface (SCMI) over SMC - * Generic handling layer - * - * Andrei Cherechesu - * Copyright 2024 NXP - */ - -#ifndef __ASM_SCMI_SMC_H__ -#define __ASM_SCMI_SMC_H__ - -#include - -struct cpu_user_regs; - -#ifdef CONFIG_SCMI_SMC - -bool scmi_handle_smc(struct cpu_user_regs *regs); - -#else - -static inline bool scmi_handle_smc(struct cpu_user_regs *regs) -{ - return false; -} - -#endif /* CONFIG_SCMI_SMC */ - -#endif /* __ASM_SCMI_H__ */ - -/* - * Local variables: - * mode: C - * c-file-style: "BSD" - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c index 4095171533..78d5bdf56f 100644 --- a/xen/arch/arm/vsmc.c +++ b/xen/arch/arm/vsmc.c @@ -21,7 +21,6 @@ #include #include #include -#include =20 /* Number of functions currently supported by Hypervisor Service. */ #define XEN_SMCCC_FUNCTION_COUNT 3 @@ -233,7 +232,7 @@ static bool handle_sip(struct cpu_user_regs *regs) if ( platform_smc(regs) ) return true; =20 - return (scmi_handle_smc(regs)) ? true : sci_handle_call(regs); + return sci_handle_call(regs); } =20 /* diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index e7a17ede3e..b31324f8d4 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -328,6 +328,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t); #define XEN_DOMCTL_CONFIG_TEE_FFA 2 =20 #define XEN_DOMCTL_CONFIG_ARM_SCI_NONE 0 +#define XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_SMC 1 =20 struct xen_arch_domainconfig { /* IN/OUT */ --=20 2.34.1 From nobody Sun Sep 14 06:21:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1756995717; cv=pass; d=zohomail.com; s=zohoarc; b=lO7fU+4psDAfCZGyhnOkn2DRkcmPCpGYRf7PacdpLgY8k+XMoW/Dr03r8HhdkO13CRDwuSLBEdy3qzgW9BTYSR2frvRyKHzFYBxgEq6l8SskzGSXFf53b99HXRrhvXPpz4R0ivQWyBX92tZ9RxVMTBn+F25Y3YwRDxeX8AWozFQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756995717; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=teOFbImDoAuyxS7ou+OcBlhl+FQv/TEZwzgs8NJKvxY=; b=J0ITUKgOaytmYJXsLxgfEZmtFqIgGhZS31vo8ONi+REi5qDwbnQM0xv6jg46k9wYDK4gJlrBCMGuE/Y2d+FdtqONecxemL3XL0dH3G2ZL/bEUqrkoB+TirUnrjbML5a00zMCWDjhVDiLl1yXXn51zpZUjl6gMswjcCqO3uZkeKs= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 17569957177751001.032320173031; Thu, 4 Sep 2025 07:21:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1110288.1459593 (Exim 4.92) (envelope-from ) id 1uuAqM-0006sj-Qt; Thu, 04 Sep 2025 14:21:42 +0000 Received: by outflank-mailman (output) from mailman id 1110288.1459593; Thu, 04 Sep 2025 14:21:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uuAqM-0006sY-ND; Thu, 04 Sep 2025 14:21:42 +0000 Received: by outflank-mailman (input) for mailman id 1110288; Thu, 04 Sep 2025 14:21:41 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uuAqK-0005ts-Sg for xen-devel@lists.xenproject.org; Thu, 04 Sep 2025 14:21:41 +0000 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazlp170110003.outbound.protection.outlook.com [2a01:111:f403:c201::3]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7867e3e3-899a-11f0-9809-7dc792cee155; Thu, 04 Sep 2025 16:21:38 +0200 (CEST) Received: from DU0PR03MB8934.eurprd03.prod.outlook.com (2603:10a6:10:473::15) by GV2PR03MB8751.eurprd03.prod.outlook.com (2603:10a6:150:a8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.27; Thu, 4 Sep 2025 14:21:29 +0000 Received: from DU0PR03MB8934.eurprd03.prod.outlook.com ([fe80::26fd:98f2:a1cc:be40]) by DU0PR03MB8934.eurprd03.prod.outlook.com ([fe80::26fd:98f2:a1cc:be40%7]) with mapi id 15.20.9052.013; Thu, 4 Sep 2025 14:21:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7867e3e3-899a-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fs6TctSJkznTpWPDHPMce9dPh9CwBCgXTCTnzypmreYTlSpZRRCW13q2a8oWVrdbeeUVISOwq86dbKU12HlroATrYj6KAfbYXXjzAxaB6/y/n5qTgGCcFHnkxXpby7CQV74FEnGTj525Xu8QStsln2xSx+DDPNfKhmH6XQyryF3vbx1twAuGyrku+C9uL/Ih6dv9ulOFF6OVrV/c4NvJTs2XOgavIZuwmy2KnFMxBFOqNZXqhs91JgtrukUfl5s8IGwvnMeF2zkynmgNpC+UeXlX5Pd3M6jMfILqxUPi1knH9bfFwKF+yxwB3R/LaE+FAXYSbDdmJNyJvhgBVyFUlQ== 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=teOFbImDoAuyxS7ou+OcBlhl+FQv/TEZwzgs8NJKvxY=; b=ZLC+/1eSYvE0LowxRh+jlJu/eljWa804S8jrSNaZfr45tTAYdottIdRmEXXZigDS4bR4bnayBGSt0MogCtjSCq/BNwMUXwq06FsRn5CRizlpUpNwYuGwvlJ3PUIb/3f4tJBndOWfhgFjF879gJRnum8h+50fuN6kum1y1+cgUKbDWi9oRa96xJHyrs669vYOA68TL9KL1a3T4w45kH93GpE7lomnpxqEHpdpO8Pdw+/Gd4NbksU7d/ahFya3Vy6OgFOMkTQOJ4cT6RlAK0jyitHBl0QLJF601Th6O86wousP3eyJBoURoKU/mGThSYfwrqgg1ca/H0GT36nXEADU6Q== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=teOFbImDoAuyxS7ou+OcBlhl+FQv/TEZwzgs8NJKvxY=; b=N+k4/zcpKgSpQOtvI88ZiuKnCEx5SWcFr2h/9uVOyq2JldPeqDOvRVL6qLnaKaP3CX0MaJGwfd0sb09jRZ4cUtThNNUpcRcDZ8V1MM//G2JyQnsZfMD+8FUNGL0kT4/Zx5B+/cRa837/4E86UGkzNzlIyCtTMksYHz/a/v68Vvf4bfbnx8N38o3u08mswD+WJVYHIBOkBqqbOAUWLX9Zzyabgnh/b5sPnUKJOarE9cZWpWENZzK4/o2j6MasGDK88JFNLPW07dQ4eFsjMlr9lUU3Uq4c0m5GL9EFPlHjQH+b5FNQErl9oAPWwitXUf1+PahlVUqeNBAqasg024ankg== From: Oleksii Moisieiev To: "xen-devel@lists.xenproject.org" CC: Andrew Cooper , Anthony PERARD , Bertrand Marquis , Jan Beulich , Juergen Gross , Julien Grall , Michal Orzel , Oleksii Moisieiev , =?iso-8859-1?Q?Roger_Pau_Monn=E9?= , Stefano Stabellini , Volodymyr Babchuk , Grygorii Strashko Subject: [PATCH v9 3/4] xen/arm: scmi-smc: passthrough SCMI SMC to domain, single agent Thread-Topic: [PATCH v9 3/4] xen/arm: scmi-smc: passthrough SCMI SMC to domain, single agent Thread-Index: AQHcHacz/gTYQbUqxEKwBpOKNI4z1w== Date: Thu, 4 Sep 2025 14:21:27 +0000 Message-ID: <15e6518d9413e073d1c6bbc33dc2bf721ddbfe00.1756995595.git.oleksii_moisieiev@epam.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU0PR03MB8934:EE_|GV2PR03MB8751:EE_ x-ms-office365-filtering-correlation-id: 8cdf7f9b-e7f2-4958-ec01-08ddebbe56e1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|7416014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?+wzbPiLEF67njxZqz/I9UOPfK4RghEeywa1BLIJjv4Q31yArguDTnbATy3?= =?iso-8859-1?Q?WBM7aSjJn5qzvin2QxKEjrGEjTc48ytd3b2mPG00wVKQ0z+KPDcusnnuBD?= =?iso-8859-1?Q?ki22Xq/TbweDbv3QWmBhJ+1ZWOVrxo+CMCKKIFJs7TprHd7SnmaCkbFINy?= =?iso-8859-1?Q?0W4kKhiOr+mWMjM5VvceMnDd8syJ9JzBxIN55Gjkn0uONWcs21ybfz0ovY?= =?iso-8859-1?Q?/zpZMQFjJZs4WVacCV8TDnlQKFr73NwB69UeGfGs8Y+N1G+B6wNpJVXPdF?= =?iso-8859-1?Q?u6nmn3KDpkuqB8ZGl8C0E4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iso-8859-1?Q?KfYuHpFUhLL7CvlYkUtjgnAkP76WOMLLh+CsIMy5sKbEaTpUC8vKbUuclD?= =?iso-8859-1?Q?9QNO16hJ754RDmuwoG93XY5r69yCJfEQlUNCZk0hPkfrnDUJ+86G5/KR3B?= =?iso-8859-1?Q?FeXQmdA+FtncZ2PMsttIcWswWaBgr1MCK1WgNqnVLI8VG0qgpNzk4sPSyh?= =?iso-8859-1?Q?qPzDY9FVPG5lIjXq6X6/3DpO8my2dyAh16tlKKPY8w3thsQPJClKhDi2Bj?= =?iso-8859-1?Q?8tr1/ZgyzpvzveivItWAGoQmK8ZQHao76Hf+cCSZ5TM2X3EoHaBj+YnPEr?= =?iso-8859-1?Q?+MrV3Z3uhNCUI/fHJhbxQ0m1fhtLGolwzMrzNxm+f0Zw=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR03MB8934.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?5n/djyPEJ/iTKUYW8HwBZEOVHDiLSOvGypj8r6biHO4Zw/AS6595JFh98v?= =?iso-8859-1?Q?owkXN4oOHb3EUVAMG9avAZt0MmmUDobVQte0BMMpTFiDf3TM1IbaWzczIh?= =?iso-8859-1?Q?oYTLjQ8bgo1h2ly/9yalOdXi1Ql5OqaT635viWndOZ6rEM1snrrWPYswZS?= =?iso-8859-1?Q?0hEuy+KVO5c2omGGsdHv84/Bbh/MdmsnRW59UQJAV9NCcFmwe7dksHkJ9g?= =?iso-8859-1?Q?tqWCWEpnJ6aKjYCtrwXrz1TbM79IDA1sNs3icxbRHZpobpYRkXs/tovpWq?= =?iso-8859-1?Q?HXLY2m3bQgLE3gMu/IpBNNkX/CiQXbD6jpf2U1JJ46ww+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YAViIERdryJPtUMAjJljpSyRGao?= =?iso-8859-1?Q?bIpIpufz92tqZdI2EhqKwyS4fkw9NYpk5OZuK/XMdu+00uEq3tkFKhjVr3?= =?iso-8859-1?Q?t/NdfHMiFbgM+nfHxViPxh61M7o5FUmTU1Ascw7IZLhBUAiKeKPllqSAs4?= =?iso-8859-1?Q?T+kPtJCHbT0BlzMmlgM6cT6jqBUQPo/9qzPxUnFkAEGJQedDIlWEU8hThZ?= =?iso-8859-1?Q?QVz/p8ZOygOvwHwHyXWBB/cLN+03aGrh2TiFTg2YXZ/N66J3nZXyogx1gH?= =?iso-8859-1?Q?cs0immE3eGfopomBk/Q8BwnJI64HDnoHkiDLVyUPmHpCRpgSkHZBJqEPUO?= =?iso-8859-1?Q?4j/ewe8cbY5W8JdoiAKIXGiE/zmMe+mJZRB/l80IRKRfTm/PvepThFWm77?= =?iso-8859-1?Q?YLN+ylTZMj7/oGrBOBkoUFJTz/FyiLQUva35UM5tXbdi9ktcr2FCBtnA?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU0PR03MB8934.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cdf7f9b-e7f2-4958-ec01-08ddebbe56e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Sep 2025 14:21:27.9229 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fkuJ7hfu6jhzbGeS23n1fsgrhLnJMAuA7t6hxzYsZyDiF+1Nk+N9QjDv6IMbiYrN32Y93rcbeK/JL6m2rkV1eZVEUu1a8DFTf45ytk7F+xo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8751 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1756995718650116600 Content-Type: text/plain; charset="utf-8" From: Grygorii Strashko The commit 3e322bef8bc0 ("xen/arm: firmware: Add SCMI over SMC calls handling layer") introduces simple driver which forwards SCMI over SMC calls from hwdom/dom0 to EL3 firmware (TF-A) with a single SCMI OSPM agent support. While it is working gracefully for hwdom/dom0 use case it doesn't cover "thin Dom0 with guest domain, which serves as Driver domain" use-case. In this case HW need to be enable in Driver domain and dom0 is performing only control functions. The EL3 SCMI firmware (TF-A) with a single SCMI OSPM agent support is pretty generic case for the default vendors SDK and new platforms. This patch enables passthrough of SCMI SMC single agent interface to the one guest domain serving as Driver domain. Configure Dom0 to enable SCMI passthrough: - dom0: add scmi-smc-passthrough to the Xen Command Line Enabled SCMI passthrough for guest using toolstack in the following way: - domD: xl.cfg add "arm_sci" option as below arm_sci =3D "type=3Dscmi_smc" - domD: xl.cfg enable access to the "arm,scmi-shmem" iomem =3D [ "47ff0,1@22001", ] - domD: add SCMI nodes to the Driver domain partial device tree as in the below example: passthrough { scmi_shm_0: sram@22001000 { compatible =3D "arm,scmi-shmem"; reg =3D <0x0 0x22001000 0x0 0x1000>; }; firmware { compatible =3D "simple-bus"; scmi: scmi { compatible =3D "arm,scmi-smc"; shmem =3D <&scmi_shm_0>; ... } } } dom0less case configuration: - add "xen,sci_type" property for required DomU ("xen,domain") node xen,sci_type=3D"scmi_smc" - add scmi nodes to the Driver domain partial device tree the same way as above and enable access to the "arm,scmi-shmem" according to dom0less documentation. For example: scmi_shm_0: sram@22001000 { compatible =3D "arm,scmi-shmem"; reg =3D <0x00 0x22001000 0x00 0x1000>; -> xen,reg =3D <0x0 0x47ff0000 0x0 0x1000 0x0 0x22001000>; -> xen,force-assign-without-iommu; }; The SCMI SMC single agent interface can be enabled for one and only one domain. In general, the configuration is similar to any other HW passthrough, except explicitly enabling SCMI with "arm_sci" xl.cfg option. Note that "arm,scmi-smc" and "arm,scmi-shmem" nodes will be removed from dom0/hwdom DT when "scmi-smc-passthrough" cmdline parameter was provided. Signed-off-by: Grygorii Strashko Signed-off-by: Oleksii Moisieiev Acked-by: Anthony PERARD # tools --- Changes in v9: - update domu_dt_sci_parse declaration to match MC3A2.R8.4 MISRA rule Changes in v8: - reneregated {helpers/types}.gen.go, dropped unneeded parameters Changes in v7: - Fix commit description. - Move scmi-smc-passthrough definition to match alphaberical order - remove unneeded initialization with NULL - changed u64 to uint64_t - Send warning if iomem permit access was failed Changes in v6: - added generated helpers and types go files - rename cmdline parameter to scmi-smc-passthrough - fix goto tag in parse_arm_sci_config Changes in v5: - rename dom0_scmi_smc_passthrough to scmi_smc_passthrough Changes in v4: - xl.cfg doc - fix comments from Stefano Stabellini - fix toolstack code as sugested by Anthony PERARD - use MATCH_OPTION() - move arm_sci struct and cfg params in "arch_arm" - add SCMI passthrough for dom0less case docs/man/xl.cfg.5.pod.in | 34 ++++++++ docs/misc/arm/device-tree/booting.txt | 15 ++++ docs/misc/xen-command-line.pandoc | 9 ++ tools/golang/xenlight/helpers.gen.go | 35 ++++++++ tools/golang/xenlight/types.gen.go | 11 +++ tools/include/libxl.h | 5 ++ tools/libs/light/libxl_arm.c | 14 ++++ tools/libs/light/libxl_types.idl | 10 +++ tools/xl/xl_parse.c | 36 ++++++++ xen/arch/arm/dom0less-build.c | 34 +++++++- xen/arch/arm/firmware/Kconfig | 4 +- xen/arch/arm/firmware/scmi-smc.c | 115 +++++++++++++++++++++++++- 12 files changed, 317 insertions(+), 5 deletions(-) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index acff45d308..3b18bcc095 100644 --- a/docs/man/xl.cfg.5.pod.in +++ b/docs/man/xl.cfg.5.pod.in @@ -3123,6 +3123,40 @@ writes will be ignored. =20 This option is only implemented for Arm where the default is enabled. =20 +=3Ditem B + +Set ARM_SCI specific options for the guest. ARM SCI is System +Control Protocol allows domain to manage various functions that are provid= ed +by HW platform firmware. + +B is a comma separated list of C settings, +from the following list: + +=3Dover 4 + +=3Ditem B + +Specifies an ARM SCI type for the guest. + +=3Dover 4 + +=3Ditem B + +Don't allow guest to use ARM SCI if present on the platform. This is the +default value. + +=3Ditem B + +Enables ARM SCMI SMC support for the guest by enabling SCMI over SMC calls +forwarding from domain to the EL3 firmware (like Trusted Firmware-A) with a +single SCMI OSPM agent support. +Should be used together with B Xen command line +option. + +=3Dback + +=3Dback + =3Dback =20 =3Dhead3 x86 diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-t= ree/booting.txt index 07acc7ba64..977b428608 100644 --- a/docs/misc/arm/device-tree/booting.txt +++ b/docs/misc/arm/device-tree/booting.txt @@ -307,6 +307,21 @@ with the following properties: passed through. This option is the default if this property is missing and the user does not provide the device partial device tree for the d= omain. =20 +- xen,sci_type + + A string property specifying an ARM SCI type for the guest. + + - "none" + Don't allow guest to use ARM SCI if present on the platform. This is t= he + default value. + + - "scmi_smc" + Enables ARM SCMI SMC support for the guest by enabling SCMI over SMC c= alls + forwarding from domain to the EL3 firmware (like Trusted Firmware-A) w= ith a + single SCMI OSPM agent support. + Should be used together with scmi-smc-passthrough Xen command line + option. + Under the "xen,domain" compatible node, one or more sub-nodes are present for the DomU kernel and ramdisk. =20 diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line= .pandoc index 4adcd7e762..518e42d965 100644 --- a/docs/misc/xen-command-line.pandoc +++ b/docs/misc/xen-command-line.pandoc @@ -2382,6 +2382,15 @@ sockets, &c. This will reduce performance somewhat,= particularly on systems with hyperthreading enabled, but should reduce power by enabling more sockets and cores to go into deeper sleep states. =20 +### scmi-smc-passthrough (ARM) +> `=3D ` + +The option is available when `CONFIG_SCMI_SMC` is compiled in, and allows = to +enable SCMI SMC single agent interface for any, but only one guest domain, +which serves as Driver domain. The SCMI will be disabled for Dom0/hwdom and +SCMI nodes removed from Dom0/hwdom device tree. +(for example, thin Dom0 with Driver domain use-case). + ### scrub-domheap > `=3D ` =20 diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/h= elpers.gen.go index 667030cbd7..8909fe8a1b 100644 --- a/tools/golang/xenlight/helpers.gen.go +++ b/tools/golang/xenlight/helpers.gen.go @@ -938,6 +938,35 @@ return fmt.Errorf("converting field Vcpus: %v", err) return nil } =20 +// NewArmSci returns an instance of ArmSci initialized with defaults. +func NewArmSci() (*ArmSci, error) { +var ( +x ArmSci +xc C.libxl_arm_sci) + +C.libxl_arm_sci_init(&xc) +defer C.libxl_arm_sci_dispose(&xc) + +if err :=3D x.fromC(&xc); err !=3D nil { +return nil, err } + +return &x, nil} + +func (x *ArmSci) fromC(xc *C.libxl_arm_sci) error { + x.Type =3D ArmSciType(xc._type) + + return nil} + +func (x *ArmSci) toC(xc *C.libxl_arm_sci) (err error){defer func(){ +if err !=3D nil{ +C.libxl_arm_sci_dispose(xc)} +}() + +xc._type =3D C.libxl_arm_sci_type(x.Type) + + return nil + } + // NewRdmReserve returns an instance of RdmReserve initialized with defaul= ts. func NewRdmReserve() (*RdmReserve, error) { var ( @@ -1163,6 +1192,9 @@ x.ArchArm.GicVersion =3D GicVersion(xc.arch_arm.gic_v= ersion) x.ArchArm.Vuart =3D VuartType(xc.arch_arm.vuart) x.ArchArm.SveVl =3D SveType(xc.arch_arm.sve_vl) x.ArchArm.NrSpis =3D uint32(xc.arch_arm.nr_spis) +if err :=3D x.ArchArm.ArmSci.fromC(&xc.arch_arm.arm_sci);err !=3D nil { +return fmt.Errorf("converting field ArchArm.ArmSci: %v", err) +} if err :=3D x.ArchX86.MsrRelaxed.fromC(&xc.arch_x86.msr_relaxed);err !=3D = nil { return fmt.Errorf("converting field ArchX86.MsrRelaxed: %v", err) } @@ -1699,6 +1731,9 @@ xc.arch_arm.gic_version =3D C.libxl_gic_version(x.Arc= hArm.GicVersion) xc.arch_arm.vuart =3D C.libxl_vuart_type(x.ArchArm.Vuart) xc.arch_arm.sve_vl =3D C.libxl_sve_type(x.ArchArm.SveVl) xc.arch_arm.nr_spis =3D C.uint32_t(x.ArchArm.NrSpis) +if err :=3D x.ArchArm.ArmSci.toC(&xc.arch_arm.arm_sci); err !=3D nil { +return fmt.Errorf("converting field ArchArm.ArmSci: %v", err) +} if err :=3D x.ArchX86.MsrRelaxed.toC(&xc.arch_x86.msr_relaxed); err !=3D n= il { return fmt.Errorf("converting field ArchX86.MsrRelaxed: %v", err) } diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/typ= es.gen.go index e26b3cdfc7..ab9d4ca7b4 100644 --- a/tools/golang/xenlight/types.gen.go +++ b/tools/golang/xenlight/types.gen.go @@ -520,6 +520,16 @@ SveType1920 SveType =3D 1920 SveType2048 SveType =3D 2048 ) =20 +type ArmSciType int +const( +ArmSciTypeNone ArmSciType =3D 0 +ArmSciTypeScmiSmc ArmSciType =3D 1 +) + +type ArmSci struct { +Type ArmSciType +} + type RdmReserve struct { Strategy RdmReserveStrategy Policy RdmReservePolicy @@ -599,6 +609,7 @@ GicVersion GicVersion Vuart VuartType SveVl SveType NrSpis uint32 +ArmSci ArmSci } ArchX86 struct { MsrRelaxed Defbool diff --git a/tools/include/libxl.h b/tools/include/libxl.h index 185f74d8a8..bc35e412da 100644 --- a/tools/include/libxl.h +++ b/tools/include/libxl.h @@ -313,6 +313,11 @@ */ #define LIBXL_HAVE_BUILDINFO_ARCH_NR_SPIS 1 =20 +/* + * libxl_domain_build_info has the arch_arm.sci* fields. + */ +#define LIBXL_HAVE_BUILDINFO_ARCH_ARM_SCI 1 + /* * LIBXL_HAVE_SOFT_RESET indicates that libxl supports performing * 'soft reset' for domains and there is 'soft_reset' shutdown reason diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c index 4a19a8d22b..7e9f8a1bc3 100644 --- a/tools/libs/light/libxl_arm.c +++ b/tools/libs/light/libxl_arm.c @@ -233,6 +233,20 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc, config->arch.sve_vl =3D d_config->b_info.arch_arm.sve_vl / 128U; } =20 + switch (d_config->b_info.arch_arm.arm_sci.type) { + case LIBXL_ARM_SCI_TYPE_NONE: + config->arch.arm_sci_type =3D XEN_DOMCTL_CONFIG_ARM_SCI_NONE; + break; + case LIBXL_ARM_SCI_TYPE_SCMI_SMC: + config->arch.arm_sci_type =3D XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_SMC; + break; + default: + LOG(ERROR, "Unknown ARM_SCI type %d", + d_config->b_info.arch_arm.arm_sci.type); + return ERROR_FAIL; + } + LOG(DEBUG, " - SCI type=3D%u", config->arch.arm_sci_type); + return 0; } =20 diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_type= s.idl index a6030a2dbd..b53e013a44 100644 --- a/tools/libs/light/libxl_types.idl +++ b/tools/libs/light/libxl_types.idl @@ -551,6 +551,15 @@ libxl_sve_type =3D Enumeration("sve_type", [ (2048, "2048") ], init_val =3D "LIBXL_SVE_TYPE_DISABLED") =20 +libxl_arm_sci_type =3D Enumeration("arm_sci_type", [ + (0, "none"), + (1, "scmi_smc") + ], init_val =3D "LIBXL_ARM_SCI_TYPE_NONE") + +libxl_arm_sci =3D Struct("arm_sci", [ + ("type", libxl_arm_sci_type), + ]) + libxl_rdm_reserve =3D Struct("rdm_reserve", [ ("strategy", libxl_rdm_reserve_strategy), ("policy", libxl_rdm_reserve_policy), @@ -725,6 +734,7 @@ libxl_domain_build_info =3D Struct("domain_build_info",[ ("vuart", libxl_vuart_type), ("sve_vl", libxl_sve_type), ("nr_spis", uint32, {'init_val': 'LIBXL_NR_= SPIS_DEFAULT'}), + ("arm_sci", libxl_arm_sci), ])), ("arch_x86", Struct(None, [("msr_relaxed", libxl_defbool), ])), diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 90c9386f5b..af86d3186d 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -1284,6 +1284,36 @@ out: if (rc) exit(EXIT_FAILURE); } =20 +static int parse_arm_sci_config(XLU_Config *cfg, libxl_arm_sci *arm_sci, + const char *str) +{ + int ret =3D 0; + char *buf2, *ptr; + char *oparg; + + if (NULL =3D=3D (buf2 =3D ptr =3D strdup(str))) + return ERROR_NOMEM; + + ptr =3D strtok(buf2, ","); + while (ptr !=3D NULL) + { + if (MATCH_OPTION("type", ptr, oparg)) { + ret =3D libxl_arm_sci_type_from_string(oparg, &arm_sci->type); + if (ret) { + fprintf(stderr, "Unknown ARM_SCI type: %s\n", oparg); + ret =3D ERROR_INVAL; + goto out; + } + } + + ptr =3D strtok(NULL, ","); + } + +out: + free(buf2); + return ret; +} + void parse_config_data(const char *config_source, const char *config_data, int config_len, @@ -2989,6 +3019,12 @@ skip_usbdev: xlu_cfg_get_defbool(config, "trap_unmapped_accesses", &b_info->trap_unmapped_accesses, 0); =20 + if (!xlu_cfg_get_string(config, "arm_sci", &buf, 1)) { + if (parse_arm_sci_config(config, &b_info->arch_arm.arm_sci, buf)) { + exit(EXIT_FAILURE); + } + } + parse_vkb_list(config, d_config); =20 d_config->virtios =3D NULL; diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c index 0094cf9e40..f00912a1ca 100644 --- a/xen/arch/arm/dom0less-build.c +++ b/xen/arch/arm/dom0less-build.c @@ -279,6 +279,36 @@ int __init arch_handle_passthrough_prop(struct kernel_= info *kinfo, return sci_assign_dt_device(kinfo->bd.d, node); } =20 +static int __init domu_dt_sci_parse(struct dt_device_node *node, + struct xen_domctl_createdomain *d_cfg) +{ + const char *sci_type; + int ret; + + d_cfg->arch.arm_sci_type =3D XEN_DOMCTL_CONFIG_ARM_SCI_NONE; + + if ( !IS_ENABLED(CONFIG_ARM_SCI) || + !dt_property_read_bool(node, "xen,sci_type") ) + return 0; + + ret =3D dt_property_read_string(node, "xen,sci_type", &sci_type); + if ( ret ) + return ret; + + if ( !strcmp(sci_type, "none") ) + d_cfg->arch.arm_sci_type =3D XEN_DOMCTL_CONFIG_ARM_SCI_NONE; + else if ( !strcmp(sci_type, "scmi_smc") ) + d_cfg->arch.arm_sci_type =3D XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_SMC; + else + { + printk(XENLOG_ERR "xen,sci_type in not valid (%s) for domain %s\n", + sci_type, dt_node_name(node)); + return -EINVAL; + } + + return 0; +} + int __init arch_parse_dom0less_node(struct dt_device_node *node, struct boot_domain *bd) { @@ -288,7 +318,9 @@ int __init arch_parse_dom0less_node(struct dt_device_no= de *node, =20 d_cfg->arch.gic_version =3D XEN_DOMCTL_CONFIG_GIC_NATIVE; d_cfg->flags |=3D XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap; - d_cfg->arch.arm_sci_type =3D XEN_DOMCTL_CONFIG_ARM_SCI_NONE; + + if ( domu_dt_sci_parse(node, d_cfg) ) + panic("Error getting SCI configuration\n"); =20 if ( !dt_property_read_u32(node, "nr_spis", &d_cfg->arch.nr_spis) ) { diff --git a/xen/arch/arm/firmware/Kconfig b/xen/arch/arm/firmware/Kconfig index bbf88fbb9a..5c5f0880c4 100644 --- a/xen/arch/arm/firmware/Kconfig +++ b/xen/arch/arm/firmware/Kconfig @@ -25,7 +25,9 @@ config SCMI_SMC doorbell mechanism and Shared Memory for transport ("arm,scmi-smc" compatible only). The value of "arm,smc-id" DT property from SCMI firmware node is used to trap and forward corresponding SCMI SMCs - to firmware running at EL3, for calls coming from the hardware domain. + to firmware running at EL3, for calls coming from the hardware domain or + driver domain. + Use with EL3 firmware which supports only single SCMI OSPM agent. =20 endchoice =20 diff --git a/xen/arch/arm/firmware/scmi-smc.c b/xen/arch/arm/firmware/scmi-= smc.c index 4c5df714c2..0835ddeeec 100644 --- a/xen/arch/arm/firmware/scmi-smc.c +++ b/xen/arch/arm/firmware/scmi-smc.c @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include #include =20 @@ -22,7 +24,11 @@ =20 #define SCMI_SMC_ID_PROP "arm,smc-id" =20 +static bool __ro_after_init opt_scmi_smc_passthrough; +boolean_param("scmi-smc-passthrough", opt_scmi_smc_passthrough); + static uint32_t __ro_after_init scmi_smc_id; +static struct domain __read_mostly *scmi_dom; =20 /* * Check if provided SMC Function Identifier matches the one known by the = SCMI @@ -50,7 +56,7 @@ static bool scmi_handle_smc(struct cpu_user_regs *regs) return false; =20 /* Only the hardware domain should use SCMI calls */ - if ( !is_hardware_domain(current->domain) ) + if ( scmi_dom !=3D current->domain ) { gdprintk(XENLOG_WARNING, "SCMI: Unprivileged access attempt\n"); return false; @@ -75,12 +81,45 @@ static bool scmi_handle_smc(struct cpu_user_regs *regs) return true; } =20 +static int +scmi_smc_domain_sanitise_config(struct xen_domctl_createdomain *config) +{ + if ( config->arch.arm_sci_type !=3D XEN_DOMCTL_CONFIG_ARM_SCI_NONE && + config->arch.arm_sci_type !=3D XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_SMC= ) + return -EINVAL; + + return 0; +} + static int scmi_smc_domain_init(struct domain *d, struct xen_domctl_createdomain *config) { - if ( !is_hardware_domain(d) ) + /* + * scmi_passthrough is not enabled: + * - proceed only for hw_domain + * - fail if guest domain has SCMI enabled. + */ + if ( !opt_scmi_smc_passthrough && !is_hardware_domain(d) ) + { + if ( config->arch.arm_sci_type =3D=3D XEN_DOMCTL_CONFIG_ARM_SCI_SC= MI_SMC ) + return -EINVAL; + else + return 0; + } + /* + * scmi_passthrough is enabled: + * - ignore hw_domain + * - proceed only for domain with SCMI enabled. + */ + if ( opt_scmi_smc_passthrough && + (config->arch.arm_sci_type =3D=3D XEN_DOMCTL_CONFIG_ARM_SCI_NONE = || + is_hardware_domain(d)) ) return 0; =20 + if ( scmi_dom ) + return -EEXIST; + + scmi_dom =3D d; d->arch.sci_enabled =3D true; printk(XENLOG_DEBUG "SCMI: %pd init\n", d); return 0; @@ -88,12 +127,80 @@ static int scmi_smc_domain_init(struct domain *d, =20 static void scmi_smc_domain_destroy(struct domain *d) { - if ( !is_hardware_domain(d) ) + if ( scmi_dom && scmi_dom !=3D d ) return; =20 + scmi_dom =3D NULL; + d->arch.sci_enabled =3D false; printk(XENLOG_DEBUG "SCMI: %pd destroy\n", d); } =20 +/* + * Handle Dom0 SCMI SMC specific DT nodes + * + * if scmi_smc_passthrough=3Dfalse: + * - Copy SCMI nodes into Dom0 device tree. + * if scmi_smc_passthrough=3Dtrue: + * - skip SCMI nodes from Dom0 DT + * - give dom0 control access to SCMI shmem MMIO, so SCMI can be passed + * through to guest. + */ +static bool scmi_smc_dt_handle_node(struct domain *d, + struct dt_device_node *node) +{ + static const struct dt_device_match shmem_matches[] __initconst =3D { + DT_MATCH_COMPATIBLE("arm,scmi-shmem"), + { /* sentinel */ }, + }; + static const struct dt_device_match scmi_matches[] __initconst =3D { + DT_MATCH_PATH("/firmware/scmi"), + { /* sentinel */ }, + }; + + /* skip scmi shmem node for dom0 if scmi not enabled */ + if ( dt_match_node(shmem_matches, node) && !sci_domain_is_enabled(d) ) + { + dt_dprintk("Skip scmi shmem node\n"); + return true; + } + + /* + * skip scmi node for dom0 if scmi not enabled, but give dom0 control + * access to SCMI shmem + */ + if ( dt_match_node(scmi_matches, node) && !sci_domain_is_enabled(d) ) + { + struct dt_device_node *shmem_node; + const __be32 *prop; + uint64_t paddr, size; + int ret; + + /* give dom0 control access to SCMI shmem */ + prop =3D dt_get_property(node, "shmem", NULL); + if ( !prop ) + return true; + + shmem_node =3D dt_find_node_by_phandle(be32_to_cpu(*prop)); + if ( !shmem_node ) + return true; + + ret =3D dt_device_get_address(shmem_node, 0, &paddr, &size); + if ( ret ) + return true; + + ret =3D iomem_permit_access(d, paddr_to_pfn(paddr), + paddr_to_pfn(paddr + size - 1)); + if ( ret ) + printk(XENLOG_WARNING + "SCMI: Failed to give access to SCMI shmem with code:= %d\n", ret); + + dt_dprintk("Skip scmi node\n"); + return true; + } + + return false; +} + static int __init scmi_check_smccc_ver(void) { if ( smccc_ver < ARM_SMCCC_VERSION_1_1 ) @@ -108,8 +215,10 @@ static int __init scmi_check_smccc_ver(void) =20 static const struct sci_mediator_ops scmi_smc_ops =3D { .handle_call =3D scmi_handle_smc, + .domain_sanitise_config =3D scmi_smc_domain_sanitise_config, .domain_init =3D scmi_smc_domain_init, .domain_destroy =3D scmi_smc_domain_destroy, + .dom0_dt_handle_node =3D scmi_smc_dt_handle_node, }; =20 /* Initialize the SCMI layer based on SMCs and Device-tree */ --=20 2.34.1 From nobody Sun Sep 14 06:21:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1756995711; cv=pass; d=zohomail.com; s=zohoarc; b=P0wKn7ewBKku+cTrUsUEnDTFB9AhWqO6kbfzXQK6lHcfJ0EbgA1m6BHQdVzOH4Fsb3Y5j1FfaACP7N/ijN7rQNsvu4yI5wGLTQMpsykmsLieNHi0dbEW/Rr8fpAKSVNbyKuPugRQP/cyiB3xMCFUlWE5y8VZW+2HH1K2oxRWS38= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756995711; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AaHCelQ59jKtKWLwfwblTdez/+Ey8JJ4o/qqx28tWCs=; b=n713c/DhzclycuRETIsVU1sd92zQ+bgOak6cscGUu6UYVdg3XHaif7Udm9cAXzYDB7sPrRBjTW3d76NJ+uFzt7nGEDWotqtq0Xv2mClGJLtQo+UBO71BWvpbcJ40vQz/HiCT+zkicI61AcHQUe/coJAWyqwOXKGoITD+fWH50xk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1756995711507431.95856135055453; Thu, 4 Sep 2025 07:21:51 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1110285.1459563 (Exim 4.92) (envelope-from ) id 1uuAqH-00067n-PM; Thu, 04 Sep 2025 14:21:37 +0000 Received: by outflank-mailman (output) from mailman id 1110285.1459563; Thu, 04 Sep 2025 14:21:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uuAqH-00067g-Kn; Thu, 04 Sep 2025 14:21:37 +0000 Received: by outflank-mailman (input) for mailman id 1110285; Thu, 04 Sep 2025 14:21:35 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uuAqF-0005ts-QV for xen-devel@lists.xenproject.org; Thu, 04 Sep 2025 14:21:35 +0000 Received: from OSPPR02CU001.outbound.protection.outlook.com (mail-norwayeastazlp170130007.outbound.protection.outlook.com [2a01:111:f403:c20f::7]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7501f5db-899a-11f0-9809-7dc792cee155; Thu, 04 Sep 2025 16:21:33 +0200 (CEST) Received: from DU0PR03MB8934.eurprd03.prod.outlook.com (2603:10a6:10:473::15) by DU0PR03MB8290.eurprd03.prod.outlook.com (2603:10a6:10:31c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.18; Thu, 4 Sep 2025 14:21:29 +0000 Received: from DU0PR03MB8934.eurprd03.prod.outlook.com ([fe80::26fd:98f2:a1cc:be40]) by DU0PR03MB8934.eurprd03.prod.outlook.com ([fe80::26fd:98f2:a1cc:be40%7]) with mapi id 15.20.9052.013; Thu, 4 Sep 2025 14:21:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7501f5db-899a-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K1h/HTSJh7gr2ZIJZCnyDO166So+wPA6iUjDi5K5ZmcjpxcFSwddRQwsCksC/8dhQ3u8150eXwtvmkYFQX466m8vwk9465mHxyXIAB2E8alfqAf7TSjzIquCMowv/rIu6jpoHnUe2U6sXOHI99eiB07eHiP0eG/LAXksew7394ROLCQwmxm49gJBAjKFfoReigNtr9bJYXJVnmf0pq8Nn8mJrQ9Qom1zukFg0lwXLF2PWDD+PBMPPr++/8VJjaUn+ZNo+OeNZTsE9++jlXOMK+/3Ijta4uFLXgPUD9zFAmPcPfrHgW1zFsoAgyIm7oU+PyM/ZKqsY5bp6bGFYzSsUA== 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=AaHCelQ59jKtKWLwfwblTdez/+Ey8JJ4o/qqx28tWCs=; b=t0SZ0KLzi5XjpCMaldxP7p+gaz65zBbZojdotruPZw1hfZTRtnYZwSPOn3NB3w42JQ8pndnVkhm5/xItXw73YAQA5wSj4RJdWiP/m3I79sq1oEuijJ7gcuN9iqgYKKed/mz8247PrJ5Qu0VI5YzEwUzx9c2lmkP6KQLNdSRnb9Z0RsaD2sApqJquW3FG9H+hEwSbQOGQ0rKRffwlo4tWQplyX/Mxg+ZMy7G1VgAa5EyE1FD1Dnc1iAXz/D4XFqkt7LrHxs5vjJ0dJ3RkIaXUcJYdZ4tSFE1NVFeAI+tjJ2kMSsJR5pAZulWP4uhwRwLPCjkeQnmYm35aXd2/4c9/uA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AaHCelQ59jKtKWLwfwblTdez/+Ey8JJ4o/qqx28tWCs=; b=sb6b8uDV6LSHwtb7PO7wDsAn2iMKvs6UiRyl2kkPZOwbuDrbHu36FQNWENVMUl3yfJLe0Sc2aPqVfCeFSzWY74nlcu+2A6/+5U36SyU/Mol16oEfBs3birU2hi3Z3UXiCYzhSoAntKtVdoepMh3WCAZMQxDaTEVBcvCQMsy0PmCRVrP54QkDOkW5/pgVLE5DIZ1/gJPWOKx/WxyHkvg5IUsoxQm9KxMP9OtWdArtVHZmk1TgfvVJtX0mec28SeZWriSAiCE+VM9KY2HVqLbwiIO3JtF7oYZbq7pG9GCH10QemdkCh6cZiUW6gErhBFC4JhQzPeFcYsOepOJMxKeCkQ== From: Oleksii Moisieiev To: "xen-devel@lists.xenproject.org" CC: Andrew Cooper , Anthony PERARD , Bertrand Marquis , Jan Beulich , Juergen Gross , Julien Grall , Michal Orzel , Oleksii Moisieiev , =?iso-8859-1?Q?Roger_Pau_Monn=E9?= , Stefano Stabellini , Volodymyr Babchuk , Grygorii Strashko Subject: [PATCH v9 4/4] docs: arm: add docs for SCMI over SMC calls forwarding driver Thread-Topic: [PATCH v9 4/4] docs: arm: add docs for SCMI over SMC calls forwarding driver Thread-Index: AQHcHaczJu4B0gXzU0Kn/cb9yNa3XQ== Date: Thu, 4 Sep 2025 14:21:28 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU0PR03MB8934:EE_|DU0PR03MB8290:EE_ x-ms-office365-filtering-correlation-id: bfe85a21-0b65-43d1-e573-08ddebbe571c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?gwF1j6gsXeE3x/HcVzW9nv/qqvnnyZT1YD8ZoMtop954CVCRLoFo3f5ojh?= =?iso-8859-1?Q?8IRszZYLMalMP6WdV5dPT4JxmP0XAH8UAJnqqlZFDc4h80a43S4+ep92ed?= =?iso-8859-1?Q?aDO3YfDde4YOaBiDC9ouZ6DZR/P0pA5EaJtq6fD4raAutB8Q8EfZTDOV6K?= =?iso-8859-1?Q?xLTtgmlFpZvT3+0Pm3NLyqKN9g5xBNqeLXe7IFXmFhLJSban8TL7q/mx8p?= =?iso-8859-1?Q?JQ/1tGE93Z9HUJt41Pg1OwMfpRzh4P/3A0xyVr4RlUYvURB7Na+wFOUsEU?= =?iso-8859-1?Q?bRkCTwMGsEw8IWQx0zGWzBFLyOg1SIlZuYrZAdEW4b0TJf7XcWQVJI0BCJ?= =?iso-8859-1?Q?JNwBt0b3f+F6Qjo9fW7omdk4un/j9+TiGfZNKLQynrM7dvNnDyhMn8hMr5?= =?iso-8859-1?Q?SICMZHaop3jct9an6o0eQ+ZCxugOSAeMkWC2dt4BkfNWXI3BkAUXZdZVY+?= =?iso-8859-1?Q?vRFMYmOEZLywTa6nqTttY7pPsLTkRQJF8wTXVu8wQn1glI6i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drxox8zLmSi3IpI9N5XWDE01DsufI/4Wj?= =?iso-8859-1?Q?Efr1BV43hWAK9MH73JvC3261r+ZG2ncuUaL3gSBejh/xPE3axoSRU0bZ4g?= =?iso-8859-1?Q?c=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR03MB8934.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?CbWxF8axaGdst0B+kaObiUS+DfhCRYe95kmcaDQya1rKFtguXVdkZyQzPr?= =?iso-8859-1?Q?QCip1hzwXZAeKlVDNGoxdO5WuNNfo3NikrU06Zc7RQBVWB+4PbpwgEpQuJ?= =?iso-8859-1?Q?dak/Ptuz/9pOVeEfOjCeFM7S9mHZ9XyIiqrTSqIAdU65vu9Xl1HyEzRcS7?= =?iso-8859-1?Q?SrKgsxwME8hHgmxbo6LmobLyasillSPgYQwXbvk9tXSg5GmC/aIqilXsq6?= =?iso-8859-1?Q?uwSXlV13sw8i4bvRDODZ+N49TAqHpn2+rAmZLwgFXesTqZirjA1omiXkYD?= =?iso-8859-1?Q?UeajE+CPTgZfzaIKOHomAK2skqDW3KXxdbjkhcHQY38GgQ8kcB6i0aa40j?= =?iso-8859-1?Q?AYNsH5hbf9o0ZRTdEdU/bR6W1K3ZxUh9tB7Y3M+/4c8oWHFyVO2V8qIYt5?= =?iso-8859-1?Q?O1LHpNSM7WKjd04YxCKg++AA7imQP6GWf0fwGbDs0fdGpDDzRhmsiazm5H?= =?iso-8859-1?Q?H654DToTHUy2ojhFeM/72LTk7+aHybaHKrfQ5BRWSqO98w+T3Gyayxv2rn?= =?iso-8859-1?Q?sdnwV/dfmB7OE6fn0d1BYUKCl1zYZYwaMW7folfctx66yyxgLmegxXvFgr?= =?iso-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BJr3RxElExkt44EHx?= =?iso-8859-1?Q?LeZNj3dqxZoawJiacpJ5SdxFdEjvaGVn7iUZ6iowwJNZMGZTfdiq0DvbPV?= =?iso-8859-1?Q?oq7CZiUIgfQ1+InZM71HF7QvApujWiCi4xqNhNZMzeEOWY2toGHtBDjUl7?= =?iso-8859-1?Q?MO0PY0/ZaK+KZrEQyJUJoUQx2lL3E3GaVBrh8xDxuGH0g5tI3M8HixoA?= =?iso-8859-1?Q?=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU0PR03MB8934.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfe85a21-0b65-43d1-e573-08ddebbe571c X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Sep 2025 14:21:28.2367 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: zJR6n9bf+6oFtLnhLcwuR850GVmi4nxhBLBsfAAaH602cglmwDfyp579dl2VSP+63pOemDbhd/7OaK4Z4uUSWjvPCcRUL6LxpZm27lTLpm8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB8290 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1756995714483116600 Content-Type: text/plain; charset="utf-8" From: Grygorii Strashko Add documentation section for Simple Arm SCMI over SMC calls forwarding driver (EL3). Signed-off-by: Grygorii Strashko Signed-off-by: Oleksii Moisieiev --- (no changes since v7) Changes in v7: - fixed typos Changes in v6: - add link to the scmi bindings used in the doc - remove mentions about HVC calls from doc - rename cmdline parameter to scmi-smc-passthrough Changes in v5: - rename dom0_scmi_smc_passthrough in documentation .../arm/firmware/arm-scmi.rst | 180 ++++++++++++++++++ docs/hypervisor-guide/arm/index.rst | 9 + docs/hypervisor-guide/index.rst | 1 + 3 files changed, 190 insertions(+) create mode 100644 docs/hypervisor-guide/arm/firmware/arm-scmi.rst create mode 100644 docs/hypervisor-guide/arm/index.rst diff --git a/docs/hypervisor-guide/arm/firmware/arm-scmi.rst b/docs/hypervi= sor-guide/arm/firmware/arm-scmi.rst new file mode 100644 index 0000000000..d65ce35acb --- /dev/null +++ b/docs/hypervisor-guide/arm/firmware/arm-scmi.rst @@ -0,0 +1,180 @@ +.. SPDX-License-Identifier: CC-BY-4.0 + +ARM System Control and Management Interface (SCMI) +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D + +The System Control and Management Interface (SCMI) [1], which is a set of = operating +system-independent software interfaces that are used in system management.= SCMI currently +provides interfaces for: + +- Discovery and self-description of the interfaces it supports +- Power domain management +- Clock management +- Reset domain management +- Voltage domain management +- Sensor management +- Performance management +- Power capping and monitoring +- Pin control protocol. + +The SCMI compliant firmware could run: + +- as part of EL3 secure world software (like Trusted Firmware-A) with + ARM SMC shared-memory transport; +- on dedicated System Control Processor (SCP) with HW mailbox shared-memor= y transport + +The major purpose of enabling SCMI support in Xen is to enable guest domai= ns access to the SCMI +interfaces for performing management actions on passed-through devices (su= ch as clocks/resets etc) +without accessing directly to the System control HW (like clock controller= s) which in most cases +can't be shared/split between domains. Or, at minimum, allow SCMI access f= or dom0/hwdom (or guest +domain serving as Driver domain). + +The below sections describe SCMI support options available for Xen. + +| [1] `Arm SCMI `_ +| [2] `System Control and Management Interface (SCMI) bindings `_ + +Simple SCMI over SMC calls forwarding driver (EL3) +------------------------------------------------------ + +The EL3 SCMI firmware (TF-A) with a single SCMI OSPM agent support is pret= ty generic case for +the default vendors SDK and new platforms with SCMI support. Such EL3 SCMI= firmware supports only +single SCMI OSPM transport (agent) with Shared memory based transport and = SMC calls as doorbell. + +The SCMI over SMC calls forwarding driver solves major problem for this ca= se by allowing +SMC calls to be forwarded from guest to the EL3 SCMI firmware. + +By default, the SCMI over SMC calls forwarding is enabled for Dom0/hwdom. + +:: + + +--------------------------+ + | | + | EL3 SCMI FW (TF-A) | + ++-------+--^--------------+ + |shmem | | smc-id + +----^--+ | + | | + +----|-+---+---+----------+ + | | | FWD | Xen | + | | +---^---+ | + +----|-----|--------------+ + | | smc-id + +----v-----+--+ +---------+ + | | | | + | Dom0/hwdom | | DomU | + | | | | + | | | | + +-------------+ +---------+ + + +The SCMI messages are passed directly through SCMI shared-memory (zero-cop= y) and driver only +forwards SMC calls. + +Compiling +^^^^^^^^^ + +To build with the SCMI over SMC calls forwarding enabled support, enable K= config option + +:: + + SCMI_SMC + +The ``CONFIG_SCMI_SMC`` is enabled by default. + +Pass-through SCMI SMC to domain which serves as Driver domain +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This section describes how to configure the SCMI over SMC calls forwarding= driver to handle use +case "thin Dom0 with guest domain, which serves as Driver domain". In this= case HW need to be +enabled in Driver domain and dom0 is performing only control functions (wi= thout accessing FW) and so, +the SCMI need to be enabled in Driver domain. + +:: + + +--------------------------+ + |EL3 SCMI FW (TF-A) | + | | + +-------------^--+-------+-+ + smc-id| |shmem0 | + | +----^--+ + +-------------++------+|----+ + |Xen | FWD || | + | +--^----+| | + +----------------|-----|----+ + smc-id | | + +-----------+ +--+-----v-----+ + | | | | + | Dom0 | | Driver | + | Control | | domain | + | | | | + +-----------+ +--------------+ + +The SCMI can be enabled for one and only one guest domain. + +First, configure Dom0 to enable SCMI pass-through using Xen Command Line +**"scmi-smc-passthrough"** option. This will disable SCMI for Dom0/hwdom a= nd SCMI nodes will +be removed from Dom0/hwdom device tree. + +**Configure SCMI pass-through for guest domain with toolstack** + +* In domain's xl.cfg file add **"arm_sci"** option as below + +:: + + arm_sci =3D "type=3Dscmi_smc" + +* In domain's xl.cfg file enable access to the "arm,scmi-shmem" + +:: + + iomem =3D [ + "47ff0,1@22001", + ] + +.. note:: It's up to the user to select guest IPA for mapping SCMI shared-= memory. + +* Add SCMI nodes to the Driver domain partial device tree as in the below = example: + +.. code:: + + passthrough { + scmi_shm_0: sram@22001000 { + compatible =3D "arm,scmi-shmem"; + reg =3D <0x0 0x22001000 0x0 0x1000>; + }; + + firmware { + compatible =3D "simple-bus"; + scmi: scmi { + compatible =3D "arm,scmi-smc"; + shmem =3D <&scmi_shm_0>; + ... + } + } + } + +Please refer to [2] for details of SCMI DT bindings. + +In general, the configuration is similar to any other HW pass-through, exc= ept explicitly +enabling SCMI with "arm_sci" xl.cfg option. + +**Configure SCMI pass-through for predefined domain (dom0less)** + +* add "xen,sci_type" property for required DomU ("xen,domain") node + +:: + + xen,sci_type=3D"scmi_smc" + +* add scmi nodes to the Driver domain partial device tree the same way as = above and enable access + to the "arm,scmi-shmem" according to dom0less documentation. For exampl= e: + +.. code:: + + scmi_shm_0: sram@22001000 { + compatible =3D "arm,scmi-shmem"; + reg =3D <0x00 0x22001000 0x00 0x1000>; + -> xen,reg =3D <0x0 0x47ff0000 0x0 0x1000 0x0 0x22001000>; + -> xen,force-assign-without-iommu; + }; diff --git a/docs/hypervisor-guide/arm/index.rst b/docs/hypervisor-guide/ar= m/index.rst new file mode 100644 index 0000000000..7aae4a0a03 --- /dev/null +++ b/docs/hypervisor-guide/arm/index.rst @@ -0,0 +1,9 @@ +.. SPDX-License-Identifier: CC-BY-4.0 + +ARM +=3D=3D=3D + +.. toctree:: + :maxdepth: 2 + + firmware/arm-scmi diff --git a/docs/hypervisor-guide/index.rst b/docs/hypervisor-guide/index.= rst index e4393b0697..520fe01554 100644 --- a/docs/hypervisor-guide/index.rst +++ b/docs/hypervisor-guide/index.rst @@ -9,3 +9,4 @@ Hypervisor documentation code-coverage =20 x86/index + arm/index \ No newline at end of file --=20 2.34.1