Hi All,
Purpose of this email is to debate on the pros and cons of having a common ARM context save/restore code. Currently each SOC has its own way of saving/restoring ARM registers and there has been a proposal to have a common code for the same instead of duplicating the same in different places. Though it is technically possible to save/restore common ARM registers in a common place, there are some constraints. 1. Each of the SOC would have it's own set of trustzone implementation which means these registers have to be saved/restored in SOC specific code. 2. Some of the ARM registers (Aux ctrl etc) can be different for different SOCs which means they cannot be handled in common code. So it means that, in the middle of common code, there needs to be many platform specific hooks so that right sequence is followed. This will make the code more unredeable and difficult to debug and maintain.
Also I am just wondering is there any other ARM SOC apart from OMAP, which saves/restores ARM registers in SW? Atleast I could not find such code in opensource.
Regards Vishwa
On Thu, 7 Oct 2010, Vishwanath Sripathy wrote:
Hi All,
Purpose of this email is to debate on the pros and cons of having a common ARM context save/restore code. Currently each SOC has its own way of saving/restoring ARM registers and there has been a proposal to have a common code for the same instead of duplicating the same in different places.
Hmmmmm, what?
Could you elaborate? I'm afraid I'm not following you.
The kernel as I know it has a common code path to save/restore registers on context switch simply because all SOCs that I'm aware of all have the same general registers to save/restore on context switch.
There are exceptions for some specialized registers, such as the XScale WMMX registers, the Cirrus MaverickCrunch registers, the VFP registers or the emulated FPA registers, etc. But those are nicely abstracted away from the common code through runtime registered thread notifier callbacks.
Nicolas
On Fri, Oct 8, 2010 at 12:55 AM, Nicolas Pitre nicolas.pitre@linaro.org
wrote:
On Thu, 7 Oct 2010, Vishwanath Sripathy wrote:
Hi All,
Purpose of this email is to debate on the pros and cons of having a
common
ARM context save/restore code. Currently each SOC has its own way of saving/restoring ARM registers and there has been a proposal to have a common code for the same instead of duplicating the same in different places.
Hmmmmm, what?
Could you elaborate? I'm afraid I'm not following you.
The kernel as I know it has a common code path to save/restore registers on context switch simply because all SOCs that I'm aware of all have the same general registers to save/restore on context switch.
There are exceptions for some specialized registers, such as the XScale WMMX registers, the Cirrus MaverickCrunch registers, the VFP registers or the emulated FPA registers, etc. But those are nicely abstracted away from the common code through runtime registered thread notifier callbacks.
I think what you are referring to is General Purpose ARM Registers which I agree are saved whenever there is a context switch. What I am talking here is other ARM registers like various Auxiliary Control regs (refer to arch/arm/mach_omap2/sleep34xx.s for complete details) which are completely lost when MPU enters OFF state in CPU Idle/suspend path.
Vishwa
Nicolas