Received: from eggs.gnu.org ([2001:4830:134:3::10]:58926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGRei-000450-I4 for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:19:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGReh-0004y9-CX for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:19:04 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:46035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGReh-0004wV-5m for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:19:03 -0500 From: Peter Maydell Date: Thu, 20 Feb 2014 11:17:16 +0000 Message-Id: <1392895054-13232-13-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1392895054-13232-1-git-send-email-peter.maydell@linaro.org> References: <1392895054-13232-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 12/30] target-arm: Restrict check_ap() use of S and R bits to v6 and earlier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno The SCTLR bits S and R (8 and 9) only exist in ARMv6 and earlier. In ARMv7 these bits RAZ, and in ARMv8 they are reassigned. Guard the use of them in check_ap() so that we don't get incorrect results for ARMv8 CPUs. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite --- target-arm/helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index d9e94f2..13707a3 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2767,6 +2767,9 @@ static inline int check_ap(CPUARMState *env, int ap, int domain_prot, switch (ap) { case 0: + if (arm_feature(env, ARM_FEATURE_V7)) { + return 0; + } if (access_type == 1) return 0; switch (env->cp15.c1_sys & (SCTLR_S | SCTLR_R)) { -- 1.8.5