-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
core: arm32: fix native_intr_handler() #1682
core: arm32: fix native_intr_handler() #1682
Conversation
@jenswi-linaro it seems this is a important fix, what is the impact if i don't have this patch applied? |
Random crashes in secure world. However, only if OP-TEE is configured for GICv3. |
@jenswi-linaro Got it, thank you. |
R12 is used as an IP register in AAPCS, I think no need to save/restore it. But considering the 8bytes aligned stack requirement, it is ok use r12 or other registers.
|
@MrVan , thanks. |
Hi jens, from your explanation, the other non-callee preserved registers should also be saved in interrupt handler. |
Yes, all non-callee preserved registers are saved in the interrupt handler with this change. |
Prior to this patch when a native interrupt was received in IRQ mode r12 wasn't saved on the stack. There's two problems with that: 1. r12 isn't a callee preserved register, but must be preserved in an exception handler 2. Without r12 an odd number of registers was saved breaking the 8 byte alignment of the stack pointer This patch fixes this by also saving r12 on the stack when handling a native interrupt in IRQ mode. Reviewed-by: Peng Fan <peng.fan@nxp.com> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Hikey) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
ca87f98
to
56f6171
Compare
Rebased, tag applied. |
Prior to this patch when a native interrupt was received in IRQ mode
r12 wasn't saved on the stack. There's two problems with that:
in an exception handler
8 byte alignment of the stack pointer
This patch fixes this by also saving r12 on the stack when handling a
native interrupt in IRQ mode.
Signed-off-by: Jens Wiklander jens.wiklander@linaro.org