From patchwork Fri Feb 28 13:40:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 25549 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2BD8520543 for ; Fri, 28 Feb 2014 13:40:05 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf5810556iec.4 for ; Fri, 28 Feb 2014 05:40:05 -0800 (PST) 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:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=ZCiFRDREAD7huO+9iA9OPXu2YXOWyHMcwkB00b3gJWA=; b=PbKwO8c8KzzMcdwt/l92Tmao43+JW3AS+NlBvbDSLb3lGb6rORWFlNvslfpbC68eFi pzf5Wo4Ip/CpVrdHyqsDy8xrXHdHz1PgR8pqBVAaQyVrvij25hiVr6a1+ToFk6vu2Wo2 p7oecSKXKNch5kBIys1sgSwOr+dWMkKbpWKhCSA7r/uf9ipfiK9IiH1bJ5QWAG/HWpfL U3U2YlsIS9m8FlEtXFFVNl+qxQjS14wpztRwfbQea+cILxMyF/8t+hwutdDzyWB987r3 WbQ4c9uUJsAyKvVxSJ9l0CIjbT6Oc6KJgcYCm81Dw9xPrur5x7VdAQ+HHd8KtbhhI4Qv pZZQ== X-Gm-Message-State: ALoCoQkD1eR6Wx6vArlFepRhdB5TTjtZJ5j5n7+d6XHvCEVzZMLSE02xz6EmyYMaqT7SF3+OeNU2 X-Received: by 10.43.161.202 with SMTP id mh10mr4147270icc.23.1393594805371; Fri, 28 Feb 2014 05:40:05 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.65 with SMTP id a59ls1114675qge.72.gmail; Fri, 28 Feb 2014 05:40:05 -0800 (PST) X-Received: by 10.58.161.46 with SMTP id xp14mr1168413veb.37.1393594805268; Fri, 28 Feb 2014 05:40:05 -0800 (PST) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id zp2si263679vec.46.2014.02.28.05.40.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Feb 2014 05:40:05 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.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.220.169; Received: by mail-vc0-f169.google.com with SMTP id hq11so735259vcb.28 for ; Fri, 28 Feb 2014 05:40:05 -0800 (PST) X-Received: by 10.220.175.198 with SMTP id bb6mr2586616vcb.31.1393594805121; Fri, 28 Feb 2014 05:40:05 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.130.193 with SMTP id u1csp54367vcs; Fri, 28 Feb 2014 05:40:04 -0800 (PST) X-Received: by 10.180.25.46 with SMTP id z14mr2568800wif.49.1393594804396; Fri, 28 Feb 2014 05:40:04 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id ho1si1660584wjb.145.2014.02.28.05.40.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Feb 2014 05:40:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WJNfW-00076U-LX; Fri, 28 Feb 2014 13:40:02 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH] target-arm: Fix incorrect setting of E bit in CPSR Date: Fri, 28 Feb 2014 13:40:02 +0000 Message-Id: <1393594802-27281-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 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.220.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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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. Signed-off-by: Peter Maydell Reported-by: Alexey Ignatov --- Whoops... I clearly need to put "check KVM still works" into my regular testing process for patches. 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)