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

Entering aarch32 state through software instruction

Hi,

I have a 64bit application running on armv8(foundation model)

My question is

1. Can I link aarch32 library to aarch64 application ?

2. Is there a way to enter aarch32 state when application is running in aarch64 state in Exception level 0 ? I tried ERET instruction, but I got Undefined instruction and Illegal instruction error.

Thanks,

Naveen

  • Hi Naveen,

    1] No - all code in the same process must be entirely either A64 or A32.

    2] The basic model of A32/A64 co-existence is based on processes and execution levels. Within one execution level sandbox (hypervisor, kernel, application) all code must be of the same type (all A32, or all A64). All execution levels higher the currently level must be at least as wide as the current level (i.e. you can build an A32 kernel on top of an A64 hypervisor, or an A32 app on top of an A64 kernel, but not the other way around). You can have multiple applications running on a kernel, and multiple kernels running on a hypervisor - the can be different provided they obey the "level higher is greater than or equal" rule, so you could have a 32-bit kernel and a 64-bit kernel both running on top 64-bit hypervisor, and both 32-bit and 64-bit applications running on top of a 64-bit kernel.

    > Is there a way to enter aarch32 state when application is running in aarch64 state in Exception level 0 ?

    An application sandbox must be started as either A32 or A64 when it is first created, so the kernel creates the sandbox and then executes an ERET to enter the sandbox it has created at the lower execution level. Once you are inside the sandbox at EL0 it is too late - the ISA width has already been decided - the application itself cannot change this.

    HTH,
    Pete