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

Re: [PATCH v2 3/8] xen/arm: Add SCMI over SMC calls handling layer


  • To: Julien Grall <julien@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrei Cherechesu <andrei.cherechesu@xxxxxxxxxxx>
  • Date: Thu, 3 Oct 2024 19:02:03 +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=5NMnEPMVzXCT8fmd3PK1T5A9vsu+k3+bQli0qyGy+vw=; b=VPedogi1sLbH/vs6dv/UWtGgISFMMFzQE3TJIPDyj51j1E/UuiO5rkBbeThFqGUoZsmKt898o49zbklDEWIIIt1cpXTbaygbC2TzXllgvJDHdcC7wqPPT4aTWmxWAaCiY7T24re8pmiXmDgqr7+OvdKNDj9WA0OxyPIa0S1yEzwSYdRtnOJf2EVphWS7sEpOKC0iTGuXHR/RjM4GLysh+jqbRR+jcVFTWZHhqMlUa8v5V7r8HbAlaII8cxKDErm8PJwk4NJW4U3qTD6CFVg+NwElfPD4M3n6Hp6YGA4b7VF/s/RmF5Rov7umQ+lq8Fm6yVvvEL6BsOQCYdO76iuIOg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LywoP5Mx02vs+pDTcDitNmaCl093q7LaOwSZCh7re2g7LBWo/XQNCwNDRjPvcvrHoc4wApIZFnuxDGjrjmg65QQ5XObvo5uALsGW4TWwVvZaYCP9cN0oIo95zkTqirWzJAQ5YcJhIivkTZdIIk6XyZDQHWTOdqgi5xONdG5ie0GnE6MXFhaSF6M4PEEUs4cwlJmMKcLxEX1z6yc5reGt9B2kJwNvJjwqj94Agxy0POyZQSAzqj244P2xHwuB27H7bDW3YO4DZLyiFIjOC6QTENM6A89LLOG5urqOVWzzE0aMjrbJ/WBmsV16KptxRDD8efewVbdIHJZT87gK/MtCCQ==
  • 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:02:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,


On 01/10/2024 12:59, Julien Grall wrote:
> Hi Andrei,
>
> On 30/09/2024 12:47, Andrei Cherechesu (OSS) wrote:
>> +/*
>> + * Generic handler for SCMI-SMC requests, currently only forwarding the
>> + * request to FW running at EL3 if it came from Dom0. Is called from the 
>> vSMC
>> + * layer for SiP SMCs, since SCMI calls are usually provided this way.
>> + * Can also be called from `platform_smc()` plat-specific callback.
>> + *
>> + * Returns true if SMC was handled (regardless of response), false 
>> otherwise.
>> + */
>> +bool scmi_handle_smc(struct cpu_user_regs *regs)
>> +{
>> +    struct arm_smccc_res res;
>> +
>> +    /* Only the hardware domain should use SCMI calls */
>> +    if ( !is_hardware_domain(current->domain) )
>> +    {
>> +        gprintk(XENLOG_ERR, "SCMI: Unprivileged d%d cannot use SCMI.\n",
>> +                current->domain->domain_id);
>> +        return false;
>> +    }
>> +
>> +    /* For the moment, forward the SCMI Request to FW running at EL3 */
>> +    arm_smccc_1_1_smc(scmi_smc_id,
>
> Actually, shouldn't this be get_user_reg(regs, 0) so we don't rely on 
> scmi_handle_smc() to be called only when this is equal to scmi_smc_id?
>
> The other option is to move the check for scmi_smc_id in this function.

I'll move the check for scmi_smc_id in this function and make it static,
to avoid exposing unnecessary complexity to the users of this layer.

Thanks for the suggestion & review.

>
> Cheers,
>

Regards,
Andrei Cherechesu



 


Rackspace

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