From patchwork Wed Feb 26 18:01:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 25382 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2051F20636 for ; Wed, 26 Feb 2014 18:15:09 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id jw12sf5720179veb.7 for ; Wed, 26 Feb 2014 10:15:08 -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: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=HMsJRSAY4SntZcEsvak1GgjkHXri/Cet7mRIqAwRz1M=; b=PpLIzyEwzvYQSlPdKR5t+ckLHuOmGwwzQh4pbjPcr5Q9EcxDcPDl9CFgGDw7r4Uhsu BBbVsg2YBob8Oj/h9N+UF12bsUvwgx9VNGWwoR2+HzxdVSTq/tj2p9PqhLLAAPwIOBBn 5L4mjTypZcx5AJFw/DOB/EXWBFZy2mKpfyZGyWGpzegPcmUUxInoctRn9v+H+aQMeIAc ms1OVp3LQO5W8VLyNMZMwtpenGtfEgPQn09vgSzH8FkPY4vuNA1k2rIXJTHCtH9U+dIT KcetLLPhyVsrvKyZ3160wwhlrV/6YFXCB6t30/nbj+cL5YIw4TQQsXqtMG0QtHfk+c2V Ut1Q== X-Gm-Message-State: ALoCoQnUIgy2q1bZBIObCAzcbhdOlXX38q35upyWllxqoxWCSt1gteyxU7Nka9N0o4lzlcmpSLnZ X-Received: by 10.58.218.40 with SMTP id pd8mr3964258vec.39.1393438508885; Wed, 26 Feb 2014 10:15:08 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.197 with SMTP id h63ls340317qgh.28.gmail; Wed, 26 Feb 2014 10:15:08 -0800 (PST) X-Received: by 10.52.243.102 with SMTP id wx6mr5771905vdc.12.1393438508642; Wed, 26 Feb 2014 10:15:08 -0800 (PST) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id tr5si437783vdc.52.2014.02.26.10.15.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Feb 2014 10:15:08 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id ij19so1329193vcb.34 for ; Wed, 26 Feb 2014 10:15:08 -0800 (PST) X-Received: by 10.221.34.211 with SMTP id st19mr6934358vcb.5.1393438508570; Wed, 26 Feb 2014 10:15:08 -0800 (PST) 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.174.196 with SMTP id u4csp45209vcz; Wed, 26 Feb 2014 10:15:08 -0800 (PST) X-Received: by 10.224.28.131 with SMTP id m3mr4099079qac.101.1393438508161; Wed, 26 Feb 2014 10:15:08 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t101si487167qge.1.2014.02.26.10.15.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 26 Feb 2014 10:15:08 -0800 (PST) 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]:42274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIj0d-0008O8-JT for patch@linaro.org; Wed, 26 Feb 2014 13:15:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIiol-0000rA-Ur for qemu-devel@nongnu.org; Wed, 26 Feb 2014 13:02:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIiok-0007MZ-KG for qemu-devel@nongnu.org; Wed, 26 Feb 2014 13:02:51 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:46191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIiok-0007Eu-E1 for qemu-devel@nongnu.org; Wed, 26 Feb 2014 13:02:50 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WIioV-000698-H6; Wed, 26 Feb 2014 18:02:35 +0000 From: Peter Maydell To: Anthony Liguori Date: Wed, 26 Feb 2014 18:01:54 +0000 Message-Id: <1393437755-23586-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1393437755-23586-1-git-send-email-peter.maydell@linaro.org> References: <1393437755-23586-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 04/45] target-arm: Fix incorrect arithmetic constructing short-form PAR for ATS ops 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.220.175 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 Correct some obviously nonsensical bit manipulation spotted by Coverity when constructing the short-form PAR value for ATS operations. Signed-off-by: Peter Maydell Message-id: 1392659525-8335-1-git-send-email-peter.maydell@linaro.org --- target-arm/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 1b111b6..c993581 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1031,8 +1031,8 @@ static void ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) env->cp15.c7_par = phys_addr & 0xfffff000; } } else { - env->cp15.c7_par = ((ret & (10 << 1)) >> 5) | - ((ret & (12 << 1)) >> 6) | + env->cp15.c7_par = ((ret & (1 << 10)) >> 5) | + ((ret & (1 << 12)) >> 6) | ((ret & 0xf) << 1) | 1; } env->cp15.c7_par_hi = 0;