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

Re: [RFC PATCH v3 2/7] xen/arm: scmi-smc: update to be used under sci subsystem


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Grygorii Strashko <gragst.linux@xxxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Mon, 24 Mar 2025 17:08:55 +0200
  • 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=cJcZU64s8E+8JKTrBjH9ibM8YLIeg7Sn3n/8HzJVY/o=; b=R1jYieDAIm05+bpYsWEllGcpmQ6/ud2Nd7xq0/xcomDLOGoJcrS2f2qq07HfDJGrV9nxMaY9tCYSflU3xcrrzHD7duV7B93IXj/jNWLQB9Nlpfa8qatEn/haf59OudXmXYeS4ChlID37SAXH5bxKXDNTj+eZ7gBnXQk9DgQjBMlSujJ5lDdKCqu6bEgTmYHhJfaHy946vhRSIAWjQjsbyz9KqYGYbRkb1jD+4muBUYBKbF4BMd7vvwrYPWIQ6GkvaitoaspfMaaLzxrp/FkowRUB5W0eDxDmuyZ0B1A2AjtIX7qfEJz1Nz2aNgkQMAp5wlqqvxOI0bQiYvjLyOXelA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KijUCaEoEzQqqj16CnWR3gCl1oeJJd7KLffb8a8r1IVi7f7pvZTsqMbICVvou7BXmN4tEGW0JUei9uXdxqr/tazXLbfbOlOfFJGzPPuF8NpSbL3Kl3A6SqNc7x/lmkpTZWc87sOnTSxfPgxVpD/7vXDsLS936kh2EHpt13/Wa+NGSyOlDv7jqCF40zoj4ExRgHkKkTzdpwsL/qBD2mJEKimVEGACgwFJXaAaHewMKoi2IQqI4Hb7eyQDB1LAOefDpSdJeESQBKsZ1kyyffw9FhY6mhBn4xT1TQrnsPBQcuV21wXo/ntcY7Ud9onl8ML6f+fnyjuLDFMEnPx1cDUqhQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Julien Grall <julien@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksii Moisieiev <oleksii_moisieiev@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Mon, 24 Mar 2025 15:09:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Stefano,

On 14.03.25 01:48, Stefano Stabellini wrote:
On Tue, 11 Mar 2025, Grygorii Strashko wrote:
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.

Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
---
  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                          |  5 +-
  xen/include/public/arch-arm.h                |  1 +
  5 files changed, 64 insertions(+), 89 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 fc7918c7fc56..02d7b600317f 100644

[...]

/*
   * Local variables:
diff --git a/xen/arch/arm/include/asm/firmware/scmi-smc.h 
b/xen/arch/arm/include/asm/firmware/scmi-smc.h
deleted file mode 100644
index 6b1a164a400e..000000000000
--- 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 <andrei.cherechesu@xxxxxxx>
- * Copyright 2024 NXP
- */
-
-#ifndef __ASM_SCMI_SMC_H__
-#define __ASM_SCMI_SMC_H__
-
-#include <xen/types.h>
-
-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 51b3c0297314..b33c69a1c22a 100644
--- a/xen/arch/arm/vsmc.c
+++ b/xen/arch/arm/vsmc.c
@@ -21,7 +21,6 @@
  #include <asm/traps.h>
  #include <asm/vpsci.h>
  #include <asm/platform.h>
-#include <asm/firmware/scmi-smc.h>
/* 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;
- return scmi_handle_smc(regs);
+    return sci_handle_call(regs);

Is this change...


  }
/*
@@ -301,8 +300,6 @@ static bool vsmccc_handle_call(struct cpu_user_regs *regs)
              break;
          case ARM_SMCCC_OWNER_SIP:
              handled = handle_sip(regs);
-            if ( !handled )
-                handled = sci_handle_call(regs);

the one allowing this to be removed?

Yes, it's just switch from API introduced by commit 3e322bef8bc0 ("xen/arm:
firmware: Add SCMI over SMC calls handling layer") to more generic SCI API.

Are we sure all possible SCIs are SIPs?

Yes, as I see it, for sure for SCMI.
SCI is platform specific and so SiP.



              break;
          case ARM_SMCCC_OWNER_TRUSTED_APP ... ARM_SMCCC_OWNER_TRUSTED_APP_END:
          case ARM_SMCCC_OWNER_TRUSTED_OS ... ARM_SMCCC_OWNER_TRUSTED_OS_END:
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 55eed9992c9d..095b1a23e30c 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
#define XEN_DOMCTL_CONFIG_ARM_SCI_NONE 0
+#define XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_SMC  1
struct xen_arch_domainconfig {
      /* IN/OUT */
--
2.34.1


--
Best regards,
-grygorii



 


Rackspace

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