public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: "Richard Earnshaw \(lists\)" <Richard.Earnshaw@arm.com>
Cc: "Torbjörn SVENSSON" <torbjorn.svensson@foss.st.com>,
	gcc-patches@gcc.gnu.org, Richard.Ball@arm.com,
	christophe.lyon@linaro.org, yvan.roux@foss.st.com
Subject: Re: [PATCH v3 1/2] arm: Zero/Sign extends for CMSE security on Armv8-M.baseline [PR115253]
Date: Wed, 12 Jun 2024 22:15:28 +0100	[thread overview]
Message-ID: <mptjzitx3pr.fsf@arm.com> (raw)
In-Reply-To: <526c9082-7e1e-492b-877b-52cac9d64353@arm.com> (Richard Earnshaw's message of "Tue, 11 Jun 2024 14:59:40 +0100")

"Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com> writes:
> On 10/06/2024 15:04, Torbjörn SVENSSON wrote:
>> Properly handle zero and sign extension for Armv8-M.baseline as
>> Cortex-M23 can have the security extension active.
>> Currently, there is an internal compiler error on Cortex-M23 for the
>> epilog processing of sign extension.
>> 
>> This patch addresses the following CVE-2024-0151 for Armv8-M.baseline.
>> 
>> gcc/ChangeLog:
>> 
>> 	PR target/115253
>> 	* config/arm/arm.cc (cmse_nonsecure_call_inline_register_clear):
>> 	Sign extend for Thumb1.
>> 	(thumb1_expand_prologue): Add zero/sign extend.
>> 
>> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
>> Co-authored-by: Yvan ROUX <yvan.roux@foss.st.com>
>> ---
>>  gcc/config/arm/arm.cc | 71 ++++++++++++++++++++++++++++++++++++++-----
>>  1 file changed, 63 insertions(+), 8 deletions(-)
>> 
>> diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc
>> index ea0c963a4d6..e7b4caf1083 100644
>> --- a/gcc/config/arm/arm.cc
>> +++ b/gcc/config/arm/arm.cc
>> [...]
>> +		    && known_ge (GET_MODE_SIZE (TYPE_MODE (ret_type)), 2))
>
> You can use known_eq here.  We'll never have any value other than 2, given the known_le (4) above and anyway it doesn't make sense to call extendhisi with any other size.

BTW, I'm surprised we need known_* in arm-specific code.  Is it actually
needed?  Or is this just a conditioned response? ;)  

Richard


  parent reply	other threads:[~2024-06-12 21:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 16:43 [PATCH] arm: Zero/Sign extends for CMSE security on Armv8-M.baseline Torbjörn SVENSSON
2024-06-06 17:19 ` Christophe Lyon
2024-06-07  8:56   ` [PATH 0/2] arm: Zero/Sign extends for CMSE security on Torbjörn SVENSSON
2024-06-07  8:56     ` [PATCH v2 1/2] arm: Zero/Sign extends for CMSE security on Armv8-M.baseline [PR115253] Torbjörn SVENSSON
2024-06-10 10:37       ` Andre Vieira (lists)
2024-06-10 12:19         ` Torbjorn SVENSSON
2024-06-10 12:51           ` Andre Vieira (lists)
2024-06-10 14:04             ` [PATCH v3 0/2] " Torbjörn SVENSSON
2024-06-10 14:04               ` [PATCH v3 1/2] " Torbjörn SVENSSON
2024-06-11 13:59                 ` Richard Earnshaw (lists)
2024-06-11 14:31                   ` Andre Vieira (lists)
2024-06-12 12:16                   ` Torbjorn SVENSSON
2024-06-12 21:15                   ` Richard Sandiford [this message]
2024-06-10 14:04               ` [PATCH v3 2/2] testsuite: Fix expand-return CMSE test for Armv8.1-M [PR115253] Torbjörn SVENSSON
2024-06-11 14:00                 ` Richard Earnshaw (lists)
2024-06-12 12:16                   ` Torbjorn SVENSSON
2024-06-07  8:56     ` [PATCH v2 " Torbjörn SVENSSON

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=mptjzitx3pr.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=Richard.Ball@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=torbjorn.svensson@foss.st.com \
    --cc=yvan.roux@foss.st.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).