On Wed, 9 Jan 2019 at 17:14, Alexander Graf <ag...@suse.de> wrote: > > On 01/09/2019 05:59 PM, Peter Maydell wrote: > > On Wed, 9 Jan 2019 at 16:52, Peter Maydell <peter.mayd...@linaro.org> wrote: > >> On Wed, 9 Jan 2019 at 15:26, Alexander Graf <ag...@suse.de> wrote: > >>> In U-boot, we switch from S-SVC -> MON -> HYP when we want to enter > >>> HYP mode. This dance seems to work ok (hence it's there in the code > >>> base), but breaks with current QEMU. > > PS: it would be helpful if the commit message said how u-boot > > is trying to go from Mon to Hyp -- some ways to try to do > > this are OK, and some are not, so whether it's supposed to > > work or not depends on what u-boot is actually doing... > > I don't fully understand all of it to be honest :). But the code is here: > > http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/cpu/armv7/nonsec_virt.S > > What I managed to understand so far is that it goes to MON using the smc > #0 call and then changes SPSR so that on return (movs pc) the mode will > be different.
Thanks -- yes, that's an exception return so it's the expected way to go from Mon to Hyp. -- PMM