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

Re: [PATCH v1] arm/optee: Use only least 32 bits for SMC type arg according to SMCCC


  • To: Roman Skakun <Roman_Skakun@xxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Wed, 6 Jan 2021 17:24:36 +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=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=glfKJyUaI5sXDPm8SMW+lj4F6N+DcQ0VCS0ea/5vKgw=; b=B/pxOzQx1HD+6OfcVEH6jvIhGEr136d5wOilwBgcJzha+e904qUq2wPxWQoOs/UFMPulNWR115yNA9omQWgJVc11EcFvo5ECDs0F4QJNMifE9UDXdk3XNlK6KGYvT1MUF+Ad1ahZpXNiBMudHZQto7bHgx08l/ahWhO/JDOfxRrDJsXlO3RfsYWRd34NFCaxKUZmeYug7FCxvNhBMn23qOGhYx9GRF4zqxds4Lop+Adfg4X+9MgctdPwWPGhiS7ZnneidCvAYCHdF6SMcB8+JS9HTYWqnImaG9EhKu2PIqpJlQphhJ5ZrgjIIFocSM7QwiuM7q/fYRLPsBC2NOe+CA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iCstC1awSraoah69oZUFmE80xPpMNS8oj5lrbq39fy5LIO8wCStQfwcFaQqHBmJKwm8/8XAR5mb0GWes+KqH61rm6F8R/7kedY6sJlfFgVBrcigpXk4NHO1YHum5h583kfx/wqA6us4Eo5swekBmVJQ6ku0uGhdP6ZpOZyXLXYjMQLOiFcq1X8edv+hZnp5Qaj1y4OGyBlYxhQx9bn7waqDD92WXIRIjdfOZAwuFa75XRZqER8SNWqgVitjFiRawsJ/WoxYt9gEdUJ0wYJ8y2IQSbrg3jpLYgMZx1woaqzKnN0fFKbM6bswEB0O3WM3fHTzGo924cWUZGcTk7DvNng==
  • Authentication-results: epam.com; dkim=none (message not signed) header.d=none;epam.com; dmarc=none action=none header.from=epam.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 06 Jan 2021 17:24:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHW5FDO/0Cfv0AE4UK/bVkTy4DtrQ==
  • Thread-topic: [PATCH v1] arm/optee: Use only least 32 bits for SMC type arg according to SMCCC

Hi Roman,

Thank you for the contribution.

Roman Skakun writes:

> This patch added additional sanity and increases an understanding for
> getting proper value from the first argument for SMC call on aarch64
> according to SMCC Convention.
>
> [0] ARM DEN0028B, page 12
>
> Signed-off-by: Roman Skakun <roman_skakun@xxxxxxxx>

Acked-by: Volodymyr Babchyk <volodymyr_babchuk@xxxxxxxx>

> ---
>  xen/arch/arm/tee/optee.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
> index ee85359742..87060b52b8 100644
> --- a/xen/arch/arm/tee/optee.c
> +++ b/xen/arch/arm/tee/optee.c
> @@ -1643,7 +1643,8 @@ static bool optee_handle_call(struct cpu_user_regs 
> *regs)
>      if ( !ctx )
>          return false;
>  
> -    switch ( get_user_reg(regs, 0) )
> +    /* Only least 32 bits are significant (see ARM DEN 0028B, page 12) */
> +    switch ( (uint32_t)get_user_reg(regs, 0) )
>      {
>      case OPTEE_SMC_CALLS_COUNT:
>          set_user_reg(regs, 0, OPTEE_MEDIATOR_SMC_COUNT);


-- 
Volodymyr Babchuk at EPAM


 


Rackspace

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