Skip to contentSkip to conversation

ARM64 EL3 Exception SP_EL3 Issue?

DISCUSSION Chad Karaginides (QUIC) 2 participants 3 messages Aug 2, 2023 – Aug 3, 2023

lore
Share & tools
lore
#0 lore raw

Hello,

I am executing the Zephyr RTOS on a QEMU A53 core with Trace32 as the frontend. I am seeing a behavior difference between the QEMU A53 core and real hardware. Execution is in EL1h and an SMC call is made. Execution transitions to EL3h but the EL1 stack pointer is not propagated to SP_EL3. Is this a potential bug or is this functionality covered in a test case somewhere? If it is a bug I have no problem diving in and trying to help fix it. I am new to QEMU but willing to help. Just wanted to make sure I am not doing something wrong first.

Thank you in advance,
Chad

#1 lore raw
Quoted 6 lines · Chad Karaginides (QUIC)

Hello,

I am executing the Zephyr RTOS on a QEMU A53 core with Trace32 as the frontend. I am seeing a behavior difference between the QEMU A53 core and real hardware. Execution is in EL1h and an SMC call is made. Execution transitions to EL3h but the EL1 stack pointer is not propagated to SP_EL3. Is this a potential bug or is this functionality covered in a test case somewhere? If it is a bug I have no problem diving in and trying to help fix it. I am new to QEMU but willing to help. Just wanted to make sure I am not doing something wrong first.

Why do you expect EL3 to execute with EL1's stack pointer? On entry to EL3 the CPU should use the SP_EL3 (which EL3 has set up before it dropped down to EL2 or EL1).

thanks
-- PMM

#2 lore raw

Sorry Peter you are right. I'm not sure why I thought I saw different behavior on a real target. Please disregard my email. Thank you for the quick reply.

Take care,
Chad

-----Original Message-----
From: Peter Maydell <[email protected]>
Sent: Thursday, August 3, 2023 2:39 AM
To: Chad Karaginides (QUIC) <[email protected]>
Cc: [email protected]
Subject: Re: ARM64 EL3 Exception SP_EL3 Issue?

Quoted 6 lines · Chad Karaginides (QUIC)

Hello,

I am executing the Zephyr RTOS on a QEMU A53 core with Trace32 as the frontend. I am seeing a behavior difference between the QEMU A53 core and real hardware. Execution is in EL1h and an SMC call is made. Execution transitions to EL3h but the EL1 stack pointer is not propagated to SP_EL3. Is this a potential bug or is this functionality covered in a test case somewhere? If it is a bug I have no problem diving in and trying to help fix it. I am new to QEMU but willing to help. Just wanted to make sure I am not doing something wrong first.

Why do you expect EL3 to execute with EL1's stack pointer?
On entry to EL3 the CPU should use the SP_EL3 (which EL3 has set up before it dropped down to EL2 or EL1).

thanks
-- PMM