From patchwork Fri Jan 15 15:37:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 8042801 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B062BBEEE5 for ; Fri, 15 Jan 2016 15:37:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0222820453 for ; Fri, 15 Jan 2016 15:37:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B5AF2044C for ; Fri, 15 Jan 2016 15:37:58 +0000 (UTC) Received: from localhost ([::1]:47686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6Rp-0007J8-OF for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Jan 2016 10:37:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6Rh-0007In-Ea for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:37:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aK6Re-0004rC-5h for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:37:49 -0500 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:34488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6Rd-0004r6-S1; Fri, 15 Jan 2016 10:37:46 -0500 Received: by mail-pf0-x244.google.com with SMTP id 65so8666319pfd.1; Fri, 15 Jan 2016 07:37:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ynGl3SzSPJv5qHEZSLdj8DrZ6R0ItoRRZeg3xgM5t4k=; b=dGUMI5jgXZ3msqb3Ecp4Pgvi/UqLgb+8jbuQlaUjIhZT14hKepub5dxZuw/mXVnwV3 Q198Iizi5bMDRTX8xaNIp+rlNUgCiQ9B70Ysf5Rh0uGx8rjXQplvJHeCnDxIGIVrkxR/ P7gHMTbQ7cGjLVdvPF5oJyje43xNg/TcMHPXmcDngZ8lKXPAgBKZYzevz5iu0CwDUyPx ZNhQS9e86+DdNeMqzOsj8LelMp30h9yByy9C0N3uxYg48J3DEozCbwVdxQvW29Ije0jG uSobJ6DNVYt916DIiUgMlIhMkXrDEM26fA+tgWBrXmA3ZvSJFvYxcayP2ALQ9+lrGCmL YHHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=ynGl3SzSPJv5qHEZSLdj8DrZ6R0ItoRRZeg3xgM5t4k=; b=eQSRyIHsZ+pbtB8hgszzSteQrp4D4bPNJmzK9bcz+uiegJA7aVx5OAXZl+8RFetC+2 dCBDYd7YfhYWzyI5Cd9WdXw7PMrgBzwct0pvnGfT1EH4D4R10ZpiBIgq3/xygT2Jpg6f NL7VKswgX5pFRCza7CaYYb8ZEYfNHeviJ+wwOV6pAvHqsZJp4wIHFK/Xs6XLrAjnYCe5 8NCHmqpjSpsegorprR+jK2bYJC+I+4g0/JkksQw+XJG42ca+R04/ZDorNYvJFQTWgoNl sd31M1V5FSSyby/8xn/yWkSIv8UUaH2ahQByrY9AmSlxS4EhIPBZvslHR689haw2Rrrs ukjQ== X-Gm-Message-State: ALoCoQltGoEXCQkaU7LE13Y1N/WTj+wm75yJ9gYD1q80nbM+7kkTpNOl1ik6fM8X+6qsO3Hd7KfM+sY1squFLBkQmn6SWBGpIw== X-Received: by 10.98.44.66 with SMTP id s63mr15887856pfs.2.1452872265099; Fri, 15 Jan 2016 07:37:45 -0800 (PST) Received: from localhost (ec2-52-8-89-49.us-west-1.compute.amazonaws.com. [52.8.89.49]) by smtp.gmail.com with ESMTPSA id m75sm16327605pfj.38.2016.01.15.07.37.43 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 15 Jan 2016 07:37:44 -0800 (PST) Date: Fri, 15 Jan 2016 16:37:37 +0100 From: "Edgar E. Iglesias" To: Peter Maydell Message-ID: <20160115153737.GL29396@toto> References: <1452796451-2946-1-git-send-email-peter.maydell@linaro.org> <1452796451-2946-2-git-send-email-peter.maydell@linaro.org> <20160115143836.GI29396@toto> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::244 Cc: Paolo Bonzini , qemu-arm , Alex =?iso-8859-1?Q?Benn=E9e?= , QEMU Developers , Patch Tracking Subject: Re: [Qemu-devel] [PATCH 1/8] target-arm: Properly support EL2 and EL3 in arm_el_is_aa64() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Jan 15, 2016 at 02:50:24PM +0000, Peter Maydell wrote: > On 15 January 2016 at 14:38, Edgar E. Iglesias wrote: > > On Thu, Jan 14, 2016 at 06:34:04PM +0000, Peter Maydell wrote: > >> Support EL2 and EL3 in arm_el_is_aa64() by implementing the > >> logic for checking the SCR_EL3 and HCR_EL2 register-width bits > >> as appropriate to determine the register width of lower exception > >> levels. > >> > >> Signed-off-by: Peter Maydell > > > > Hi Peter, > > > > On the ZynqMP we've got the Cortex-A53 EL3 RW configurable at reset > > time. At some later point we'll likely have to implement that > > runtime option... > > That might be tricky, we fairly well bake in "AARCH64 feature means > 64-bit highest EL" at the moment. The KVM code takes the approach > of "if it's not going to reset in AArch64 then unset the feature bit". > > Anyway, we'll cross that bridge when we get to it. > > Do you have much locally extra that you needed for enabling > EL3 in the Cortex-A53? I have an ARM Trusted Firmware + OP-TEE > setup now that I'm going to use to work through the missing bits, > but if you've already gone through that effort there's no need > my duplicating work... I don't have anything immediate for EL3 beyond enabling it and some boot thing for a15/aarch32 to allow me to run my tests. I haven't really looked at the boot in detail for aa32 so I haven't bothered submitting it. This is it: commit b30c7102624241a67ebb2d3df70e88a4148f68a4 Author: Edgar E. Iglesias Date: Sun Sep 13 09:52:01 2015 +0200 target-arm: Start EL3 capable ARMv7 cores in MON mode Signed-off-by: Edgar E. Iglesias diff --git a/target-arm/cpu.c b/target-arm/cpu.c index f6f5539..485965f 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -164,6 +164,9 @@ static void arm_cpu_reset(CPUState *s) #else /* SVC mode with interrupts disabled. */ env->uncached_cpsr = ARM_CPU_MODE_SVC; + if (arm_feature(env, ARM_FEATURE_EL3)) { + env->uncached_cpsr = ARM_CPU_MODE_MON; + } env->daif = PSTATE_D | PSTATE_A | PSTATE_I | PSTATE_F; /* On ARMv7-M the CPSR_I is the value of the PRIMASK register, and is * clear at reset. Initial SP and PC are loaded from ROM.