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

Re: [RFC PATCH v5 02/10] xen/arm: scmi-smc: update to be used under sci subsystem


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Wed, 27 Aug 2025 09:02:20 +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=eVRJD/FmGe2MSXvM4mkEiVtZBLzPpImx5UumxDWy7w0=; b=pEGI19heIww3+61Brfw0jhzgD9cOszP5icPW9CZsPDago43qxT3/m6jX7LjlVxYIOAFgKHEiZnSQeLFwnb453C6SwEpvB7pYoCITtMomddsvYqPtOBiJu4EgcEdCqnvHDtRkyBrSeot0AC4dn7ie1SlmU7ekWHyEjRqPIaKF77v2yQgDro9i5ozVN0KgCNC23ziIB4qambuZTIUBVkJk/qc9tlM4aJlFFVYZ304+cKyyFYwC03PiDedtelZfg8Vf2MZdBOALCGaC3mrBWbiwXnp+hz4yZ5v/+Dsf7XsvbRj4B8H+ycv381OKWWI5e+dwniXp+EfBxZ/aebvyX7Robg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=v8SHMNKOu9HTR2edlr4Yf1kTrht1mscU0v8L2XkN92qMlXM24Teu0WrK/YV2vHCJWlV11o+ruuSEVpoHU073T6erglX2B6CkhTQbj3PPbg9aYZlQ1joV0Ek7fw262HD7BG5oA+6hC9Vum9PUCr/LWc8OOW3qts+EmacTvpR8XLiOC7TCS07ka4LXDUEcQsHNs2pI1E2suJyqkFPid9QDyOD32XFfm9+LXUhPe7wuXiu+4VYbwrATv5dgUeBDRL/Exti8XY4xmbrEHXCZgy4ZUf7J5yvffgCjLoCYc6ybsVW3LwBcB4dMNmSKgt3mI0poiVo3+AFfvnp9WoOz5BdOkg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, 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>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Delivery-date: Wed, 27 Aug 2025 09:02:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb+v2VN6PNmY5o9E6echLDtYWg47RvkxgAgAbZdoA=
  • Thread-topic: [RFC PATCH v5 02/10] xen/arm: scmi-smc: update to be used under sci subsystem


On 23/08/2025 03:26, Stefano Stabellini wrote:
> On Tue, 22 Jul 2025, Oleksii Moisieiev wrote:
>> From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
>>
>> 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 <grygorii_strashko@xxxxxxxx>
>> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@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 fc7918c7fc..bbf88fbb9a 100644
>> --- a/xen/arch/arm/firmware/Kconfig
>> +++ b/xen/arch/arm/firmware/Kconfig
>> @@ -8,9 +8,18 @@ config ARM_SCI
>>   
>>   menu "Firmware Drivers"
>>   
>> +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.
>>   
>> +endchoice
>> +
>>   endmenu
>> diff --git a/xen/arch/arm/firmware/scmi-smc.c 
>> b/xen/arch/arm/firmware/scmi-smc.c
>> index 33473c04b1..13d1137592 100644
>> --- a/xen/arch/arm/firmware/scmi-smc.c
>> +++ b/xen/arch/arm/firmware/scmi-smc.c
>> @@ -9,6 +9,7 @@
>>    * Copyright 2024 NXP
>>    */
>>   
>> +#include <asm/device.h>
>>   #include <xen/acpi.h>
>>   #include <xen/device_tree.h>
>>   #include <xen/errno.h>
>> @@ -16,12 +17,11 @@
>>   #include <xen/sched.h>
>>   #include <xen/types.h>
>>   
>> +#include <asm/firmware/sci.h>
>>   #include <asm/smccc.h>
>> -#include <asm/firmware/scmi-smc.h>
>>   
>>   #define SCMI_SMC_ID_PROP   "arm,smc-id"
>>   
>> -static bool __ro_after_init scmi_enabled;
>>   static uint32_t __ro_after_init scmi_smc_id;
>>   
>>   /*
>> @@ -41,14 +41,11 @@ static bool scmi_is_valid_smc_id(uint32_t fid)
>>    *
>>    * Returns true if SMC was handled (regardless of response), false 
>> otherwise.
>>    */
>> -bool scmi_handle_smc(struct cpu_user_regs *regs)
>> +static bool scmi_handle_smc(struct cpu_user_regs *regs)
>>   {
>>       uint32_t fid = (uint32_t)get_user_reg(regs, 0);
>>       struct arm_smccc_res res;
>>   
>> -    if ( !scmi_enabled )
>> -        return false;
>> -
>>       if ( !scmi_is_valid_smc_id(fid) )
>>           return false;
>>   
>> @@ -78,49 +75,45 @@ bool scmi_handle_smc(struct cpu_user_regs *regs)
>>       return true;
>>   }
>>   
>> -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;
> Should we also check for config->arch.sci_type ==
> XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_SMC ?
>
Current changes assume that only SCMI_SMC is present. This check was 
added in the subsequent patch when multiagent was introduced.
>> +    d->arch.sci_enabled = true;
>> +    printk(XENLOG_DEBUG "SCMI: %pd init\n", d);
>>       return 0;
>>   }

 


Rackspace

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