From patchwork Mon Mar 10 15:09:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 25986 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CF0622055F for ; Mon, 10 Mar 2014 15:27:50 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf19103485pab.9 for ; Mon, 10 Mar 2014 08:27:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=U0BJhJpRH7GSFVU4Vn6X9Je/HWXtQln3/atlPC7lI3o=; b=AqQSX3alnvL4FVeybaBm8Jm1md4ccbPVl3kOhVG843/HWHxsUnAu+0VOuAufIfMg/4 gFalYBYrvRlHrQ0WlH1LDzjoTQbNOKhwi8sd9cV3ojoT8iUdjIpwt21BIFJNjOmecuup QAwtN5mxnq35ZGlOZ4bGnX+Zwz6pOb5QLJDenvRqsYqDixH4IKV9iPgFCJJw1fjTvHdS I7dtdFlFMqNiJdQSxlitR944F/Jgp24MPVL6e5xMNumKQFCPwPHe0r2hGCWrliClUHl5 JJl81x+5sFA4DtNhny6/9nVDRPuP5H3YvGeP5q2Xba9tQwu/Z6PlfUWFw8e+wdYiEe+H +SGg== X-Gm-Message-State: ALoCoQk0QJhmDqA7dSbninAnuP0kQMjcrQKkeb1iwXEqJqmjJ0dEffATDM+wm/4gre9RIy4yeFAB X-Received: by 10.66.252.1 with SMTP id zo1mr14987622pac.40.1394465270124; Mon, 10 Mar 2014 08:27:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.33 with SMTP id 30ls2186835qgs.22.gmail; Mon, 10 Mar 2014 08:27:49 -0700 (PDT) X-Received: by 10.58.255.233 with SMTP id at9mr23978859ved.20.1394465269895; Mon, 10 Mar 2014 08:27:49 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id sm10si4838292vec.5.2014.03.10.08.27.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Mar 2014 08:27:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so7471442veb.28 for ; Mon, 10 Mar 2014 08:27:49 -0700 (PDT) X-Received: by 10.220.67.18 with SMTP id p18mr23144891vci.14.1394465269819; Mon, 10 Mar 2014 08:27:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp126806vck; Mon, 10 Mar 2014 08:27:49 -0700 (PDT) X-Received: by 10.224.60.71 with SMTP id o7mr41208336qah.38.1394465269345; Mon, 10 Mar 2014 08:27:49 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h5si5719150qas.148.2014.03.10.08.27.49 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 10 Mar 2014 08:27:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:49387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN27I-0003YV-Si for patch@linaro.org; Mon, 10 Mar 2014 11:27:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN26b-0002e2-2H for qemu-devel@nongnu.org; Mon, 10 Mar 2014 11:27:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WN26a-0001wP-9t for qemu-devel@nongnu.org; Mon, 10 Mar 2014 11:27:05 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:46626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN26a-0001wH-26 for qemu-devel@nongnu.org; Mon, 10 Mar 2014 11:27:04 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WN1pQ-0002Ms-6N; Mon, 10 Mar 2014 15:09:20 +0000 From: Peter Maydell To: Anthony Liguori Date: Mon, 10 Mar 2014 15:09:12 +0000 Message-Id: <1394464160-9074-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1394464160-9074-1-git-send-email-peter.maydell@linaro.org> References: <1394464160-9074-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PULL 1/9] target-arm: Fix incorrect setting of E bit in CPSR 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Commit 4cc35614a moved the exception mask bits out of env->uncached_cpsr and into env->daif. However the env->daif contents are AArch64 style mask bits, which include not just the AArch32 AIF bits but also the new D bit (masks debug exceptions). This means that when reconstructing the AArch32 CPSR value we must not allow the D bit in env->daif to get into the CPSR, because the corresponding bit in the CPSR is E, the endianness bit. This bug didn't affect execution under TCG because we don't implement endianness-swapping and so simply ignored the E bit; however it meant that kernel booting under KVM failed, because KVM does honour the E bit. Reported-by: Alexey Ignatov Signed-off-by: Peter Maydell --- 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 90f85f1..d44e603 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2478,7 +2478,7 @@ uint32_t cpsr_read(CPUARMState *env) (env->CF << 29) | ((env->VF & 0x80000000) >> 3) | (env->QF << 27) | (env->thumb << 5) | ((env->condexec_bits & 3) << 25) | ((env->condexec_bits & 0xfc) << 8) - | (env->GE << 16) | env->daif; + | (env->GE << 16) | (env->daif & CPSR_AIF); } void cpsr_write(CPUARMState *env, uint32_t val, uint32_t mask)