Received: from eggs.gnu.org ([2001:4830:134:3::10]:36402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWScK-0007Uv-Er for qemu-devel@nongnu.org; Thu, 18 Feb 2016 12:43:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWScI-0001gE-RC for qemu-devel@nongnu.org; Thu, 18 Feb 2016 12:43:52 -0500 References: <1455556977-3644-1-git-send-email-peter.maydell@linaro.org> <1455556977-3644-9-git-send-email-peter.maydell@linaro.org> From: Sergey Fedorov Message-ID: <56C602CE.60409@gmail.com> Date: Thu, 18 Feb 2016 20:43:42 +0300 MIME-Version: 1.0 In-Reply-To: <1455556977-3644-9-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/11] target-arm: Forbid mode switch to Mon from Secure EL1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , qemu-arm@nongnu.org, patches@linaro.org On 15.02.2016 20:22, Peter Maydell wrote: > In v8 trying to switch mode to Mon from Secure EL1 is an > illegal mode switch. (In v7 this is impossible as all secure > modes except User are at EL3.) We can handle this case by > making a switch to Mon valid only if the current EL is 3, > which then gives the correct answer whether EL3 is AArch32 > or AArch64. > > Signed-off-by: Peter Maydell Reviewed-by: Sergey Fedorov > --- > target-arm/helper.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/target-arm/helper.c b/target-arm/helper.c > index 4074b97..e7b3eb3 100644 > --- a/target-arm/helper.c > +++ b/target-arm/helper.c > @@ -5188,7 +5188,7 @@ static int bad_mode_switch(CPUARMState *env, int mode) > return !arm_feature(env, ARM_FEATURE_EL2) > || arm_current_el(env) < 2 || arm_is_secure(env); > case ARM_CPU_MODE_MON: > - return !arm_is_secure(env); > + return arm_current_el(env) < 3; > default: > return 1; > }