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

[RFC PATCH v4 0/8] xen/arm: scmi: introduce SCI SCMI SMC multi-agent support


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Mon, 19 May 2025 15:50:55 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PUkju2omIIym+Lx1lnHzTO4HLWdLui4dm1V50RKOGHc=; b=hvyOHLx3EAkfyatxnudy9BRmSBcKEiLxARmME1VQnSS6z5Oe/6KJUTN+LpdN0Lf3ne9aZMVVPdt/aZCHtfur1blC+r4fLJ3c2ZUfruiAGG6ftNVVnSiHoabEHTqHjaN0joYtMaRoLWAGDuZRQyOv7NaIqYguUUiZAQqecJqDklA/dUIT7Rr1ufdRs1mwTki+60b6r6DCHcBl949vQP3/PzSbHSbkK7OnUnC4MaI+ILk2hdbxZWc8DBeDYGncTB+8pOUhO+i7WrsI+HupSXr8RFbi2QPMiDk0v94kHe8PN3/rpI411Mp2GC4l/0bSLUtmqjZkvzTGvBRzgwRi6AzEPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IVhH1F94F8WcCg02MnqypWYfjYA5Rs8TFx2DewgksMl9LrKTx4wRYIzVlOOKEx5NDGy28yVyhPuv2UsFl0larQMcMSqEYH+MLCeig5vkHiMjBVpcIMNTIp5NFay3lckXyBS0l8wqnpajB9Y0onabwggn1K00P0VQxpmtvnN8VYm9NLcYxYKA9gDBFzO5+OgpV1n5EPVpYP1FDoEbwzo4pKNngpHdhqVLh8F91YF4rTSwWAG6bp17BMDyJA00ybslqE574Om2OO5Jqqivf6BDEZk3o7/RUVLOKjWCD/uj+R8stWdlvRRsdAjD02A0MBy+dkUJiz6Yba2oLx1ak4iyWA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Delivery-date: Mon, 19 May 2025 15:51:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbyNXOhvC4eZK2DUaLACAnive8zg==
  • Thread-topic: [RFC PATCH v4 0/8] xen/arm: scmi: introduce SCI SCMI SMC multi-agent support

Inroducing V4 RFC patch series  on top of the Xen version 4.20-rc2
which includes implementation of the SCI SCMI SMC multi-agent support.

Patch 1 "xen/arm: add generic SCI subsystem"
- rebased and refactored
- introduced DEVICE_ARM_SCI DT device class and used for SCI drivers probing
instead of custom,
  linker sections based implementation.
- added SCI API for Dom0 DT handling, instead of manipulating with ARM arch
dom0 code directly.
- RFC changes in XEN_DOMCTL_assign_device OP processing

Patch 2 "xen/arm: scmi-smc: update to be used under sci subsystem"
- update driver introduced by commit 3e322bef8bc0 ("xen/arm: firmware: Add SCMI
over SMC calls
handling layer") be used under sci subsystem.
- no functional changes in general

Patch 3 "xen/arm: scmi-smc: passthrough SCMI SMC to guest domain
This is new change which allows passthrough SCMI SMC, single agent interface to
guest domain
cover use case "thin Dom0 with guest domain, which serves as Driver domain".
See patch commit message for full description.

Patch 4 - docs: arm: add docs for SCMI over SMC calls forwarding
driver
- add documentation section for Simple Arm SCMI over SMC/HVC calls
forwarding driver.

Patch 5 - xen/domctl: extend XEN_DOMCTL_assign_device to handle not
only iommu
- add chainged handling of assigned DT devices to support
access-controller functionality through SCI framework.
Change was done in two parts:
 - update iommu_do_dt_domctl() to check for dt_device_is_protected()
 and not fail if DT device is not protected by IOMMU
 -add chained call to sci_do_domctl() to do_domctl()

Patch 6 - xen/arm: scmi: introduce SCI SCMI SMC multi-agent driver
- added "xen,scmi-secondary-agents" property in "chosen" to inform SCI SCMI
multi-agent driver
  about available agents and their configuration. It defines <agent_id> to
<smc-id,scmi_shm> map.
  This option is Xen specific as Xen is the only one entry in the system which
need to know
  about SCMI multi-agent support and configuration.
- each guest using SCMI should be configured with SCMI agent_id, so SCMI
  FW can implement Agent-specific permission policy.
  -- dom0: dom0_scmi_agent_id=<agent_id> in Xen command line option
  -- toolstack: arm_sci = "type=scmi_smc_multiagent,agent_id=<agent_id>"
  -- dom0less: "xen,sci_type", "xen,sci_agent_id" properties in
"xen,domain" nodes.
- factored out SCMI generic definitions (re-usable)
- factored out SCMI shmem code (re-usable)
- the SCMI passthrough configuration for guest domains is similar to any other
HW passthrough cfg.

Patch 7 - docs: arm: add SCI SCMI SMC multi-agent driver docs
- add SCI SCMI SMC multi-agent driver documentation.

Patch 8 - docs: arm: proposal to add separate SCMI node for Xen agent
- proposal to add separate SCMI DT node for Xen management agent under
chosen of xen-config node, lile Hyperlaunch "xen,config".

This proposal introduces a new approach to the Xen multi-domain
configuration, where all Xen-specific configuration has been moved
under the "/chosen" node. This requires less Dom0 device tree
manipulation and isolates Xen configuration from domain configuration.

This approach provides the following device tree (DT) parameters:

- "xen,scmi-secondary-agents": A Xen-specific parameter under the
  "/chosen" node, which describes the SCMI agent configuration for
  the domains.
- the SCMI configuration for Xen (privileged agent) and the shared
  memory configuration for all agents are provided under the "/chosen"
  node and are used strictly by Xen for its initial configuration.
- the scmi_shm and SCMI configuration for Dom0 are placed in the
  "/firmware/scmi" node so that they can be moved to Dom0 without
  any changes.

This configuration allows the use of Xen-specific nodes to provide
information strictly needed by Xen while using the default SCMI
configuration for Dom0 and other domains. As a result, no additional
bindings need to be introduced to the device tree.
This simplifies the Xen SCMI multi-agent configuration and utilizes
generic device tree bindings for the domains.

Code can be found at:
https://github.com/oleksiimoisieiev/xen/tree/scmi_upstrv4

[1] RFC v2:
http://patchwork.kernel.org/project/xen-devel/cover/cover.1644341635.git.oleksii_moisieiev@xxxxxxxx/
[2] RFC v3:
https://patchwork.kernel.org/project/xen-devel/patch/20250311111618.1850927-1-grygorii_strashko@xxxxxxxx
SCMI spec:
https://developer.arm.com/documentation/den0056/e/?lang=en

SCMI bindings:
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/access-controllers/access-controllers.yaml

Reference EL3 FW:
RPI5: https://github.com/xen-troops/arm-trusted-firmware/commits/rpi5_dev/
Renesas v4h:
https://github.com/GrygiriiS/arm-trusted-firmware/commits/rcar_gen4_v2.7_v4x-scmi_upd/

base-commit: dbe60f244c (Update Xen to 4.21, 2025-02-21)

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
- 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
- toolstack comments from Anthony PERARD
- added dom0less support
- added doc for "xen,scmi-secondary-agents"

Grygorii Strashko (6):
  xen/arm: scmi-smc: update to be used under sci subsystem
  xen/arm: scmi-smc: passthrough SCMI SMC to domain, single agent
  docs: arm: add docs for SCMI over SMC calls forwarding driver
  xen/domctl: extend XEN_DOMCTL_assign_device to handle not only iommu
  docs: arm: add SCI SCMI SMC multi-agent driver docs
  docs: arm: proposal to add separate SCMI node for Xen agent

Oleksii Moisieiev (2):
  xen/arm: add generic SCI subsystem
  xen/arm: scmi: introduce SCI SCMI SMC multi-agent driver

 MAINTAINERS                                   |   6 +
 .../arm/firmware/arm-scmi-proposal.rst        | 224 +++++
 .../arm/firmware/arm-scmi.rst                 | 442 +++++++++
 docs/hypervisor-guide/arm/index.rst           |   9 +
 docs/hypervisor-guide/index.rst               |   1 +
 docs/man/xl.cfg.5.pod.in                      |  47 +
 docs/misc/arm/device-tree/booting.txt         |  75 ++
 docs/misc/xen-command-line.pandoc             |  18 +
 tools/include/libxl.h                         |   5 +
 tools/libs/light/libxl_arm.c                  |  18 +
 tools/libs/light/libxl_types.idl              |  12 +
 tools/xl/xl_parse.c                           |  48 +
 xen/arch/arm/device.c                         |   5 +
 xen/arch/arm/dom0less-build.c                 |  49 +
 xen/arch/arm/domain.c                         |  12 +-
 xen/arch/arm/domain_build.c                   |  11 +-
 xen/arch/arm/firmware/Kconfig                 |  36 +-
 xen/arch/arm/firmware/Makefile                |   2 +
 xen/arch/arm/firmware/sci.c                   | 191 ++++
 xen/arch/arm/firmware/scmi-proto.h            | 164 ++++
 xen/arch/arm/firmware/scmi-shmem.c            | 173 ++++
 xen/arch/arm/firmware/scmi-shmem.h            |  45 +
 xen/arch/arm/firmware/scmi-smc-multiagent.c   | 860 ++++++++++++++++++
 xen/arch/arm/firmware/scmi-smc.c              | 191 +++-
 xen/arch/arm/include/asm/domain.h             |   5 +
 xen/arch/arm/include/asm/firmware/sci.h       | 214 +++++
 xen/arch/arm/include/asm/firmware/scmi-smc.h  |  41 -
 xen/arch/arm/vsmc.c                           |   4 +-
 xen/common/domctl.c                           |  19 +
 xen/drivers/passthrough/device_tree.c         |   6 +
 xen/include/asm-generic/device.h              |   1 +
 xen/include/public/arch-arm.h                 |   8 +
 32 files changed, 2856 insertions(+), 86 deletions(-)
 create mode 100644 docs/hypervisor-guide/arm/firmware/arm-scmi-proposal.rst
 create mode 100644 docs/hypervisor-guide/arm/firmware/arm-scmi.rst
 create mode 100644 docs/hypervisor-guide/arm/index.rst
 create mode 100644 xen/arch/arm/firmware/sci.c
 create mode 100644 xen/arch/arm/firmware/scmi-proto.h
 create mode 100644 xen/arch/arm/firmware/scmi-shmem.c
 create mode 100644 xen/arch/arm/firmware/scmi-shmem.h
 create mode 100644 xen/arch/arm/firmware/scmi-smc-multiagent.c
 create mode 100644 xen/arch/arm/include/asm/firmware/sci.h
 delete mode 100644 xen/arch/arm/include/asm/firmware/scmi-smc.h

-- 
2.34.1



 


Rackspace

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