From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xdewf-0006Eq-NB for qemu-devel@nongnu.org; Mon, 13 Oct 2014 08:41:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xdewb-00030E-Ks for qemu-devel@nongnu.org; Mon, 13 Oct 2014 08:41:49 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:57601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xdewb-000308-DT for qemu-devel@nongnu.org; Mon, 13 Oct 2014 08:41:45 -0400 Received: by mail-la0-f48.google.com with SMTP id gi9so6677409lab.35 for ; Mon, 13 Oct 2014 05:41:43 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1412957023-11105-3-git-send-email-greg.bellows@linaro.org> References: <1412957023-11105-1-git-send-email-greg.bellows@linaro.org> <1412957023-11105-3-git-send-email-greg.bellows@linaro.org> From: Peter Maydell Date: Mon, 13 Oct 2014 14:41:22 +0200 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v6 02/32] target-arm: add arm_is_secure() function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Bellows Cc: Sergey Fedorov , QEMU Developers , Fabian Aggeler , "Edgar E. Iglesias" On 10 October 2014 18:03, Greg Bellows wrote: > From: Fabian Aggeler > > arm_is_secure() function allows to determine CPU security state > if the CPU implements Security Extensions/EL3. > arm_is_secure_below_el3() returns true if CPU is in secure state > below EL3. > > Signed-off-by: Sergey Fedorov > Signed-off-by: Fabian Aggeler > Signed-off-by: Greg Bellows > > ========== > > v5 -> v6 > - Broaden CONFIG_USER conditional > - Merge resulting false returns with common comment > - Globally change Aarch# to AArch# > - Replace direct access of env->aarch64 with is_a64() > --- > target-arm/cpu.h | 42 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 42 insertions(+) > > diff --git a/target-arm/cpu.h b/target-arm/cpu.h > index 81fffd2..4f6db0f 100644 > --- a/target-arm/cpu.h > +++ b/target-arm/cpu.h > @@ -753,6 +753,48 @@ static inline int arm_feature(CPUARMState *env, int feature) > return (env->features & (1ULL << feature)) != 0; > } > > +#if !defined(CONFIG_USER_ONLY) > +/* Return true if exception level below EL3 is in secure state */ This is still missing the clarifying comment I was hoping for. Make this: /* Return true if exception levels below EL3 are in secure state, * or would be following an exception return to that level. * Unlike arm_is_secure() (which is alvays a question about the * _current_ state of the CPU) this doesn't care about the current * EL or mode. */ and then you can add my reviewed-by tag. thanks -- PMM