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

Re: [PATCH v2 4/8] xen/arm: vsmc: Enable handling SiP-owned SCMI SMC calls


  • To: Julien Grall <julien@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrei Cherechesu <andrei.cherechesu@xxxxxxxxxxx>
  • Date: Thu, 3 Oct 2024 19:04:44 +0300
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.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=4AprMTSjiftUEuICpNCK0LIyqpyHWZEGFNkm8Q01d2Q=; b=DpLbU6nbUzpiAVHbU9WrwEE4yuil8q1Irr2rU3S7XQUEu7/hrqIUHE0S2PLn3lgI7H+jbRfX3UsO7qvQIa0WHYBzQ99wQUDEFk7tgtlyHc4QBNX7ku/7/X9nOzJzSSTzjCaawzQmJ4FxuEgtwD1DMnsIkKQk5ISqFGza775hkc6GsgrrEnz39zv6MeQuDQXBZh8Jny1OrtEnTo+rH7vO4eq3AKvOoYXnk7cHVlL9nzAdUA/3E2T3oBNwB5YKIu8AI5C4INEn8Yld8db7mSV3GxCaggfoi1An6JuB4oQYLdYxcFd7oLsGL/Luq89xDtHJCNTshJ0cZD7QO9zW/HLnPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e+2i0F9P0Axi/dwQdlECZi2CeEMJ67skv9xomo9Z1aPNUN2sSnqyFNtlryyLhLsqZ4JJGs2HGYmfgXYbECCIgcBoSlUBYyOnNrrtKkLD9rU5g44z1LSEa6SVxj6M20NBtWsZmQiLT8UaqlFKPbHuzVbh6YIphF59iCtscEjZh2oQ1XFkVuq1hmP46pf0PBda1ryvgpWPGWy23/vRVqR3vr0CLkNi8jERZJPJaioogapIzoCXXL/U5kQQfxrU8lWQi5e/DLN26daFP1NIpFtxM33j/FD4Thdz1W8i74VGzXWQ/ZwxX+b0jstm1ZVRlPLBpDN4/JDwaJes7U45u2kllg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com;
  • Cc: S32@xxxxxxx, Andrei Cherechesu <andrei.cherechesu@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 03 Oct 2024 16:04:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,


On 01/10/2024 12:46, Julien Grall wrote:
> Hi,
>
> On 30/09/2024 12:47, Andrei Cherechesu (OSS) wrote:
>> From: Andrei Cherechesu <andrei.cherechesu@xxxxxxx>
>>
>> Change the handling of SiP SMC calls to be more generic,
>> instead of directly relying on the `platform_smc()` callback
>> implementation.
>>
>> Try to handle the SiP SMC first through the `platform_smc()`
>> callback (if implemented). If not handled, check if the
>> SCMI layer is available and that the SMC is a valid SCMI
>> message. Handle it then within the SCMI layer which forwards
>> it to EL3 FW, only if the SMC comes from Dom0.
>
> NIT: I would remove the last sentence as this is implementation details. But 
> if you want to keep it, then s/Dom0/Hardware domain/

Agree, I'll remove it.

>
>
>>
>> Signed-off-by: Andrei Cherechesu <andrei.cherechesu@xxxxxxx>
>> ---
>>   xen/arch/arm/vsmc.c | 19 ++++++++++++++++++-
>>   1 file changed, 18 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
>> index 7f2f5eb9ce..0de194a132 100644
>> --- a/xen/arch/arm/vsmc.c
>> +++ b/xen/arch/arm/vsmc.c
>> @@ -14,6 +14,7 @@
>>   #include <asm/cpufeature.h>
>>   #include <asm/monitor.h>
>>   #include <asm/regs.h>
>> +#include <asm/scmi-smc.h>
>>   #include <asm/smccc.h>
>>   #include <asm/tee/ffa.h>
>>   #include <asm/tee/tee.h>
>> @@ -224,6 +225,22 @@ static bool handle_sssc(struct cpu_user_regs *regs)
>>       }
>>   }
>>   +/* Secure Calls defined by the Silicon Provider (SiP) */
>> +static bool handle_sip(struct cpu_user_regs *regs)
>> +{
>> +    uint32_t fid = (uint32_t)get_user_reg(regs, 0);
>> +
>> +    /* Firstly, let each platform define custom handling for these SMCs */
>> +    if ( platform_smc(regs) )
>> +        return true;
>> +
>> +    /* Otherwise, if valid SCMI SMC, forward the call to EL3 */
>
> This comment is likely going to stale. This is up to smci_handle_smc() to 
> decide what to do. So I would remove this comment.

I'll remove this, since the behaviour is up to the SCMI SMC layer.

>
>
> With that:
>
> Acked-by: Julien Grall <jgrall@xxxxxxxxxx>

Thanks for the review.

>
> Cheers,
>

Regards,
Andrei C




 


Rackspace

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