From patchwork Fri Sep 4 15:05:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 53098 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id E660522E23 for ; Fri, 4 Sep 2015 15:07:23 +0000 (UTC) Received: by lagj9 with SMTP id j9sf8711197lag.0 for ; Fri, 04 Sep 2015 08:07:22 -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: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=LOEl+1co++UePywL2peEKldTRqtxr8JXPD8uXnTfuws=; b=iVDAElNPXWhNnTT1nXa8RKoqjikCxNLYgCxSp2FBd9xJzs/MhmH5BGLcKeQVtHiR1n ZKP38HdWClQAfL5K0JcIrfdSmlZ1G7eTKN4vcRITtp98HUdTbDUaa+vAg2BWVxTrEBd9 i0ayF8w+JTckC5Dz41BrwTS5CrYz/zjXXtMgPCpmDLt+ZDiTGvjkvxOiPelYQsjgLIZM /rzy389o/mI6fikUMzyDFQuHJ7+VYxIlYZyFuT5nByZkebKCkjhQuIMf6B2lLYcg9Dsy PzCgXQkh1KHNeaSwypyo336uXXQLu+NlC8USK18wUSLkvWvi3SUEWp5mo26oDm5ImKim Z8Mw== X-Gm-Message-State: ALoCoQmc3UJo2rZ2dovXanvrqbe2Yi5VK/+ZE0UTRsd5m9Pm5VQf+Ju2cGk6l0YG2h9Zx0G5uFiz X-Received: by 10.112.144.99 with SMTP id sl3mr1150675lbb.12.1441379242484; Fri, 04 Sep 2015 08:07:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.201 with SMTP id s9ls362283laj.40.gmail; Fri, 04 Sep 2015 08:07:22 -0700 (PDT) X-Received: by 10.152.37.196 with SMTP id a4mr4161845lak.59.1441379242316; Fri, 04 Sep 2015 08:07:22 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id du6si2555834lbc.41.2015.09.04.08.07.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Sep 2015 08:07:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lanb10 with SMTP id b10so15297740lan.3 for ; Fri, 04 Sep 2015 08:07:21 -0700 (PDT) X-Received: by 10.152.28.193 with SMTP id d1mr4155691lah.72.1441379241894; Fri, 04 Sep 2015 08:07:21 -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.112.164.42 with SMTP id yn10csp2043628lbb; Fri, 4 Sep 2015 08:07:21 -0700 (PDT) X-Received: by 10.55.197.139 with SMTP id k11mr6019204qkl.11.1441379240938; Fri, 04 Sep 2015 08:07:20 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id m18si3053965qki.104.2015.09.04.08.07.20 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 04 Sep 2015 08:07:20 -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]:60543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXsaG-0001Ot-5Q for patch@linaro.org; Fri, 04 Sep 2015 11:07:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXsZ9-0008TB-O0 for qemu-devel@nongnu.org; Fri, 04 Sep 2015 11:06:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXsZ5-0000os-Pp for qemu-devel@nongnu.org; Fri, 04 Sep 2015 11:06:11 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:35023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXsZ5-0000iE-Jm for qemu-devel@nongnu.org; Fri, 04 Sep 2015 11:06:07 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZXsYu-0006Fg-RK for qemu-devel@nongnu.org; Fri, 04 Sep 2015 16:05:56 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 4 Sep 2015 16:05:46 +0100 Message-Id: <1441379156-23939-18-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1441379156-23939-1-git-send-email-peter.maydell@linaro.org> References: <1441379156-23939-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 Subject: [Qemu-devel] [PULL 17/27] target-arm: Fix arm_excp_unmasked() function 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mailfrom=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 From: Sergey Sorokin There is an error in arm_excp_unmasked() function: bitwise operator & is used with integer and bool operands causing an incorrect zeroed result. The patch fixes it. Signed-off-by: Sergey Sorokin Message-id: 1441209238-16881-1-git-send-email-afarallax@yandex.ru Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target-arm/cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index c794afc..4bd5dc8 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -1520,8 +1520,8 @@ static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx, CPUARMState *env = cs->env_ptr; unsigned int cur_el = arm_current_el(env); bool secure = arm_is_secure(env); - uint32_t scr; - uint32_t hcr; + bool scr; + bool hcr; bool pstate_unmasked; int8_t unmasked = 0; @@ -1548,7 +1548,7 @@ static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx, * set then FIQs can be masked by CPSR.F when non-secure but only * when FIQs are only routed to EL3. */ - scr &= !((env->cp15.scr_el3 & SCR_FW) && !hcr); + scr = scr && !((env->cp15.scr_el3 & SCR_FW) && !hcr); pstate_unmasked = !(env->daif & PSTATE_F); break;