Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion to add bit- macros for EXC_RETURN/Integrity Signature flags #340

Closed
ioannisg opened this issue Mar 21, 2018 · 11 comments
Closed

Comments

@ioannisg
Copy link

As a developer, implementing exception & fault handling functions for Cortex-M MCUs, I would like to have standard (CMSIS) bit-mask macro #defines for EXC_RETURN flags, namely, ES, SPSEL, Mode, S, Ftype etc., so I would not have to define those in OS/application source code.

Particularly for ARMv8-M with Security Extension: I would also like to have a macro definition for the value of the Integrity Signature.

@JonatanAntoni
Copy link
Member

Hi @ioannisg,

Thanks for getting in touch about this.
At the first glance your suggestion looks reasonable to me. Are you willing to collaborate? A pull-request with the proposed enhancements is very appreciated.

Cheers,
Jonatan

@ioannisg
Copy link
Author

@JonatanAntoni Yes, I can work on an PR for this one. Will keep you posted.

@JonatanAntoni
Copy link
Member

Great. That would be very helpful as team capacity is always the limiting factor. Thanks.

@ReinhardKeil
Copy link
Collaborator

We added added defines to CMSIS-Core(M) for EXC_RETURN values.

Sorry we have not found the value of Integrity Signature (is this documented somewhere? why is this value important as it is checked by HW only?)

@salkinium
Copy link
Contributor

salkinium commented May 28, 2018

is this documented somewhere?

In the ARMv8-M ARM.

screen shot 2018-05-28 at 17 46 14

@ioannisg
Copy link
Author

@ReinhardKeil thanks a lot for the update; the reasoning behind having the needs to check the Integrity Signature in Software could be as follows:

Assume a Cortex-M33 with Security Extensions.
In a SecureFault handler the developer needs to handle SecureFault exception triggered by Non-Secure code.
It is straightforward to dump the Non-Secure stack information. However, the developer may want to also dump the Secure stack information, too.
Now, if the fault has occurred during a Non-Secure exception which has interrupted the Secure execution, the Secure state has stacked the additional state context and the top of the stack contains the integrity signature. [In case of a Non-Secure function call the top of the stack contains the return address to Secure state.]
The integrity signature is needed, in order to see if there is also the additional context.

@JonatanAntoni
Copy link
Member

Hi @ioannisg,

can you confirm that the enhancements provided are functional and fulfill your requirements?
If so, please be so kind and close this issue.

Cheers,
Jonatan

@flit
Copy link
Contributor

flit commented Jun 21, 2018

@JonatanAntoni It would be best if EXC_INTEGRITY_SIGNATUR could be spelled as EXC_INTEGRITY_SIGNATURE. Saving a single character is not worth an abnormal spelling. 😄 Thanks!

@JonatanAntoni
Copy link
Member

Hi @flit,

Thanks for pointing this out.
We will spent this huge amount of additional disk space ;)

Cheers,
Jonatan

JonatanAntoni added a commit that referenced this issue Jun 22, 2018
- EXC_INTEGRITY_SIGNATURE define that was added in #c4c089d.
- Changed comment from Offse:t to Offset: added in #9e8e488.

Change-Id: I6a6f6e02c2e4371281d97cedd4cb2d5a5ea09394
JonatanAntoni added a commit that referenced this issue Jun 22, 2018
- EXC_INTEGRITY_SIGNATURE define that was added in c4c089d.
- Changed comment from Offse:t to Offset: added in 9e8e488.

Change-Id: I6a6f6e02c2e4371281d97cedd4cb2d5a5ea09394
JonatanAntoni pushed a commit that referenced this issue Sep 12, 2018
… includes.

SPSEL is bit[2] with resulting mask value of 4.
Bug introduced with issue #340.
@JonatanAntoni
Copy link
Member

Hi @ioannisg, May I ask you to cross check the provided changes and finally close this issue, please?

@ioannisg
Copy link
Author

Hi @ioannisg, May I ask you to cross check the provided changes and finally close this issue, please?

Looks good, sorry for delaying this

JiafeiPan pushed a commit to nxp-mcuxpresso/CMSIS_5 that referenced this issue Aug 8, 2023
JiafeiPan pushed a commit to nxp-mcuxpresso/CMSIS_5 that referenced this issue Aug 8, 2023
JiafeiPan pushed a commit to nxp-mcuxpresso/CMSIS_5 that referenced this issue Aug 8, 2023
- EXC_INTEGRITY_SIGNATURE define that was added in 711825c.
- Changed comment from Offse:t to Offset: added in f4991b1.

Change-Id: I6a6f6e02c2e4371281d97cedd4cb2d5a5ea09394
JiafeiPan pushed a commit to nxp-mcuxpresso/CMSIS_5 that referenced this issue Aug 8, 2023
… includes.

SPSEL is bit[2] with resulting mask value of 4.
Bug introduced with issue ARM-software#340.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants