We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello Experts,
Reading armv8 documentation, I understand that switching between execution states require a change of exception levels. I would like to know if I can mix Aarch32 and Aarch64 userspace binaries within a process in the following manner:
1. User space Aarch32 binary (EL0) invokes sys call.
2. Kernel (EL1, Aarch64 code) sets up EL0 stack for Aarch64 and return to a specific address that falls in a Aarch64 shared library. (EL0 LR is set to a different return address)
This of course assumes that the sys call is a new implementation in the kernel that also takes care of Aarch64 ABI before returning to userspace. If this isn't feasible, are there other ways we can get 32-bit and 64-bit binaries within the same process to work atop 64-bit kernel?
Thanks for reading.
Linux specifically forbids this mixing AArch32 and AArch64 within a process, but the architecture does not (since there's no such thing as "a process" architecturally). So if you're making your own kernel, this could be done.
So typically you wouldn't want to do this because of other issues it would cause, and there's potentially a bunch of other things you'll need to do or handle to cope with it. But architecturally it's possible.
Thanks Ben.