From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:58201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghHQy-0003K5-Ic for qemu-devel@nongnu.org; Wed, 09 Jan 2019 12:14:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghHQm-0006zp-If for qemu-devel@nongnu.org; Wed, 09 Jan 2019 12:14:23 -0500 References: <20190109152430.32359-1-agraf@suse.de> From: Alexander Graf Message-ID: <92dba7da-f3fc-b7dc-6896-cf8d58cc7f17@suse.de> Date: Wed, 9 Jan 2019 18:14:10 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [Qemu-devel] [PATCH] target/arm: Allow to switch from MON->HYP on AArch32 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-arm , Tom Rini , Michal Simek , QEMU Developers , Stephen Warren , =?UTF-8?Q?Alex_Benn=c3=a9e?= On 01/09/2019 05:59 PM, Peter Maydell wrote: > On Wed, 9 Jan 2019 at 16:52, Peter Maydell wrote: >> On Wed, 9 Jan 2019 at 15:26, Alexander Graf 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. But please double check whether this is supposed to work - I don't find mode switching on ARM terribly intuitive ;). Alex