]> git.ipfire.org Git - thirdparty/gcc.git/commit
arm: testsuite: improve detection of CMSE hardware.
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 18 Jun 2021 16:13:04 +0000 (17:13 +0100)
committerRichard Earnshaw <rearnsha@arm.com>
Tue, 24 Aug 2021 13:25:51 +0000 (14:25 +0100)
commite5b56e805835b3052f67a03c0379db0adc1300a3
treedbac351bce56fb42999172b2360abfcfad6fc0f0
parent931d1c208a697b06aae9a7ba55e7a78981dcbccf
arm: testsuite: improve detection of CMSE hardware.

The test for CMSE support being available in hardware currently
relies on the compiler not optimizing away a secure gateway operation.
But even that is suspect, because the SG instruction is just a NOP
on armv8-m implementations that do not support the security extension.

Replace the existing test with a new one that reads and checks
the appropriate hardware feature register (memory mapped).  This has
to be run from secure mode, but that shouldn't matter, because if we
can't do that we can't really test the CMSE extensions anyway.  We
retain the SG instruction to ensure the test can't pass accidentally
if run on pre-armv8-m devices.

gcc/testsuite:
* lib/target-supports.exp (check_effective_target_arm_cmse_hw):
New function.

(cherry picked from commit 79fb2700bdbab4212346d907be6063c5a32d3836)
gcc/testsuite/lib/target-supports.exp