From: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>
To: <gcc-patches@gcc.gnu.org>, <Richard.Earnshaw@arm.com>,
Richard Biener <rguenther@suse.de>,
Jakub Jelinek <jakub@redhat.com>,
Richard Sandiford <richard.sandiford@arm.com>
Cc: <Richard.Ball@arm.com>, <yvan.roux@foss.st.com>
Subject: [PING^2] [PATCH v2] testsuite: Verify r0-r3 are extended with CMSE
Date: Tue, 21 May 2024 13:06:45 +0200 [thread overview]
Message-ID: <c1dd2063-3602-440d-908f-2533c69d697d@foss.st.com> (raw)
In-Reply-To: <88b756bf-21d8-4d2d-bd5b-6c795f93345e@foss.st.com>
Gentle ping!
Kind regards,
Torbjörn
On 2024-05-14 13:01, Torbjorn SVENSSON wrote:
> Hi,
>
> I'm not sure if the previous "ok" from Richard on the v1 is enough for
> this or if there needs another approval.
>
> Adding extra maintainers since Richard Earnshaw appears to be busy the
> past weeks.
>
> Kind regards,
> Torbjörn
>
> On 2024-05-06 13:50, Torbjorn SVENSSON wrote:
>> Hi,
>>
>> Forgot to mention when I sent the patch that I would like to commit it
>> to the following branches:
>>
>> - releases/gcc-11
>> - releases/gcc-12
>> - releases/gcc-13
>> - releases/gcc-14
>> - trunk
>>
>> Kind regards,
>> Torbjörn
>>
>> On 2024-05-02 12:50, Torbjörn SVENSSON wrote:
>>> Add regression test to the existing zero/sign extend tests for CMSE to
>>> verify that r0, r1, r2 and r3 are properly extended, not just r0.
>>>
>>> boolCharShortEnumSecureFunc test is done using -O0 to ensure the
>>> instructions are in a predictable order.
>>>
>>> gcc/testsuite/ChangeLog:
>>>
>>> * gcc.target/arm/cmse/extend-param.c: Add regression test. Add
>>> -fshort-enums.
>>> * gcc.target/arm/cmse/extend-return.c: Add -fshort-enums option.
>>>
>>> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
>>> ---
>>> .../gcc.target/arm/cmse/extend-param.c | 21 +++++++++++++++----
>>> .../gcc.target/arm/cmse/extend-return.c | 4 ++--
>>> 2 files changed, 19 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/gcc/testsuite/gcc.target/arm/cmse/extend-param.c
>>> b/gcc/testsuite/gcc.target/arm/cmse/extend-param.c
>>> index 01fac786238..d01ef87e0be 100644
>>> --- a/gcc/testsuite/gcc.target/arm/cmse/extend-param.c
>>> +++ b/gcc/testsuite/gcc.target/arm/cmse/extend-param.c
>>> @@ -1,5 +1,5 @@
>>> /* { dg-do compile } */
>>> -/* { dg-options "-mcmse" } */
>>> +/* { dg-options "-mcmse -fshort-enums" } */
>>> /* { dg-final { check-function-bodies "**" "" "" } } */
>>> #include <arm_cmse.h>
>>> @@ -78,7 +78,6 @@ __attribute__((cmse_nonsecure_entry)) char
>>> enumSecureFunc (enum offset index) {
>>> if (index >= ARRAY_SIZE)
>>> return 0;
>>> return array[index];
>>> -
>>> }
>>> /*
>>> @@ -88,9 +87,23 @@ __attribute__((cmse_nonsecure_entry)) char
>>> enumSecureFunc (enum offset index) {
>>> ** ...
>>> */
>>> __attribute__((cmse_nonsecure_entry)) char boolSecureFunc (bool
>>> index) {
>>> -
>>> if (index >= ARRAY_SIZE)
>>> return 0;
>>> return array[index];
>>> +}
>>> -}
>>> \ No newline at end of file
>>> +/*
>>> +**__acle_se_boolCharShortEnumSecureFunc:
>>> +** ...
>>> +** uxtb r0, r0
>>> +** uxtb r1, r1
>>> +** uxth r2, r2
>>> +** uxtb r3, r3
>>> +** ...
>>> +*/
>>> +__attribute__((cmse_nonsecure_entry,optimize(0))) char
>>> boolCharShortEnumSecureFunc (bool a, unsigned char b, unsigned short
>>> c, enum offset d) {
>>> + size_t index = a + b + c + d;
>>> + if (index >= ARRAY_SIZE)
>>> + return 0;
>>> + return array[index];
>>> +}
>>> diff --git a/gcc/testsuite/gcc.target/arm/cmse/extend-return.c
>>> b/gcc/testsuite/gcc.target/arm/cmse/extend-return.c
>>> index cf731ed33df..081de0d699f 100644
>>> --- a/gcc/testsuite/gcc.target/arm/cmse/extend-return.c
>>> +++ b/gcc/testsuite/gcc.target/arm/cmse/extend-return.c
>>> @@ -1,5 +1,5 @@
>>> /* { dg-do compile } */
>>> -/* { dg-options "-mcmse" } */
>>> +/* { dg-options "-mcmse -fshort-enums" } */
>>> /* { dg-final { check-function-bodies "**" "" "" } } */
>>> #include <arm_cmse.h>
>>> @@ -89,4 +89,4 @@ unsigned char __attribute__((noipa)) enumNonsecure0
>>> (ns_enum_foo_t * ns_foo_p)
>>> unsigned char boolNonsecure0 (ns_bool_foo_t * ns_foo_p)
>>> {
>>> return ns_foo_p ();
>>> -}
>>> \ No newline at end of file
>>> +}
next prev parent reply other threads:[~2024-05-21 11:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-24 15:55 [PATCH] arm: Zero/Sign extends for CMSE security Richard Ball
2024-04-25 10:01 ` Richard Earnshaw (lists)
2024-04-25 11:47 ` Torbjorn SVENSSON
2024-04-25 14:25 ` Richard Ball
2024-04-26 8:39 ` Torbjorn SVENSSON
2024-04-26 9:19 ` Richard Earnshaw (lists)
2024-04-27 14:13 ` [PATCH] testsuite: Verify r0-r3 are extended with CMSE Torbjörn SVENSSON
2024-04-30 15:11 ` Richard Earnshaw (lists)
2024-04-30 15:37 ` Torbjorn SVENSSON
2024-04-30 16:50 ` Richard Earnshaw (lists)
2024-05-02 10:50 ` [PATCH v2] " Torbjörn SVENSSON
2024-05-06 11:50 ` Torbjorn SVENSSON
2024-05-14 11:01 ` [PING] " Torbjorn SVENSSON
2024-05-21 11:06 ` Torbjorn SVENSSON [this message]
2024-05-22 10:55 ` Richard Earnshaw (lists)
2024-05-22 11:14 ` Torbjorn SVENSSON
2024-05-22 11:54 ` Richard Earnshaw (lists)
2024-05-22 19:49 ` Torbjorn 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=c1dd2063-3602-440d-908f-2533c69d697d@foss.st.com \
--to=torbjorn.svensson@foss.st.com \
--cc=Richard.Ball@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=rguenther@suse.de \
--cc=richard.sandiford@arm.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).