This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to know if the processor is in EL0 state on armv8?

Hi Fellows,

I want to determine in code, if the processor is in EL0 mode or not. I read CurrentEL register to do this but if my code is running from EL0, it throws an exception since we can't access CurrentEL from EL0. Is there any alternative and easy way to do determine mode that works even at EL0? Thanks.

Regards,

Mughees

Parents
  • There's no straightforward method I know of and I guess this is deliberate as any such facility would have to have virtualization support. Any particular reason you want this, are you wanting to run the same code and do different things at different exception levels for instance? I think you'd need to pass a parameter I'm afraid, alternatives like saving the state in a location or the thread id register sound like more trouble than they're worth.

Reply
  • There's no straightforward method I know of and I guess this is deliberate as any such facility would have to have virtualization support. Any particular reason you want this, are you wanting to run the same code and do different things at different exception levels for instance? I think you'd need to pass a parameter I'm afraid, alternatives like saving the state in a location or the thread id register sound like more trouble than they're worth.

Children