public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jens Wiklander <jens.wiklander@linaro.org>
To: u-boot@lists.denx.de
Subject: [PATCH] smcc: fix sign bit expansion
Date: Thu, 21 Jan 2021 07:54:34 +0100	[thread overview]
Message-ID: <20210121065434.GA906556@jade> (raw)
In-Reply-To: <20210105200240.372419-1-volodymyr_babchuk@epam.com>

On Tue, Jan 05, 2021 at 08:03:11PM +0000, Volodymyr Babchuk wrote:
> Signed ARM_SMCCC_FAST_CALL value is shifted to 31'st bit. Then, it is expanded
> to 64 bit value, which results in 1s in higher 32 bits.
> 
> This causes corrupted values in 64-bit SMC IDs and issues in buggy handlers of
> 32-bit calls.
> 
> We need to make ARM_SMCCC_FAST_CALL unsigned long, so it would work properly
> on 32 bit architectures.
> 
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> ---
>  include/linux/arm-smccc.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

You may want to make the prefix "smccc:" (note the extra c) instead.

Cheers,
Jens

> 
> diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
> index 2d1e6cc156..7f2be23394 100644
> --- a/include/linux/arm-smccc.h
> +++ b/include/linux/arm-smccc.h
> @@ -11,8 +11,8 @@
>   * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html
>   */
>  
> -#define ARM_SMCCC_STD_CALL		0
> -#define ARM_SMCCC_FAST_CALL		1
> +#define ARM_SMCCC_STD_CALL		0UL
> +#define ARM_SMCCC_FAST_CALL		1UL
>  #define ARM_SMCCC_TYPE_SHIFT		31
>  
>  #define ARM_SMCCC_SMC_32		0
> -- 
> 2.29.2

  reply	other threads:[~2021-01-21  6:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 20:03 [PATCH] smcc: fix sign bit expansion Volodymyr Babchuk
2021-01-21  6:54 ` Jens Wiklander [this message]
2021-01-28 23:56 ` [PATCH] smccc: " Tom Rini

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=20210121065434.GA906556@jade \
    --to=jens.wiklander@linaro.org \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox