On 16 March 2016 at 22:19, Jean-Christophe DUBOIS <j...@tribudubois.net> wrote: > Hi Peter, > > I am wondering what is the "correct" (simple?) way in QEMU to put a CPU in a > particular state (HYP, SVC, MON, ...) after I reset it (using cpu_reset()). > > For example, if I reset a core that has "has_el3" property it will start in > EL3 mode.
If it's AArch64, yes. If it's AArch32 then it will start in Secure-SVC (which is EL3, but the distinction is that if you wanted NS-SVC then what you need to flip is the NS bit.) > Now what is the simple way to transition this CPU to EL1 before starting > running it with target_cpu_class->set_pc(target_cpu_state, entry); There is no convenient API provided for this -- if you look at boot.c it just directly tweaks registers. We might want to abstract this out a bit better. thanks -- PMM