All of lore.kernel.org
 help / color / mirror / Atom feed
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Roman Skakun <Roman_Skakun@epam.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v1] arm/optee: Use only least 32 bits for SMC type arg according to SMCCC
Date: Wed, 6 Jan 2021 17:24:36 +0000	[thread overview]
Message-ID: <871rey567g.fsf@epam.com> (raw)
In-Reply-To: <123c27ed53ab50ca6f605a96002dcc7e1b7d3e6e.1609931750.git.rm.skakun@gmail.com>


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@epam.com>

Acked-by: Volodymyr Babchyk <volodymyr_babchuk@epam.com>

> ---
>  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

  reply	other threads:[~2021-01-06 17:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 11:26 [PATCH v1] arm/optee: Use only least 32 bits for SMC type arg according to SMCCC Roman Skakun
2021-01-06 17:24 ` Volodymyr Babchuk [this message]
2021-01-06 18:02 ` Julien Grall
2021-01-06 23:22   ` Volodymyr Babchuk
2021-01-08 10:27     ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rey567g.fsf@epam.com \
    --to=volodymyr_babchuk@epam.com \
    --cc=Roman_Skakun@epam.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.