From patchwork Thu Jun 19 17:36:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 32242 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D5126206A0 for ; Thu, 19 Jun 2014 17:44:05 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id eu11sf9192958pac.10 for ; Thu, 19 Jun 2014 10:44:05 -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=eVRY367bKxrkmb/FS/Rb4EGgpiUJfynHZlMA3w98ilw=; b=DP2bS8EXAFbtCJNGf+kYsbRO5JtIhMjHcIGpx5Ge/qwHf7S5NO1CPCuJcbBcOusHuF lLjNtYO+FP16nFqN5NQgdMvQKiJ+h6SGAySClmxpUC+avKdGXW4Z94evmvLug+rEe55/ hWE9FndbVkaVf1FJpcUt0CZm6ho7J/zzQG+Esz4CxdGgzJpY1X5EbCyOU19pVsZvGZbU ehKUzdLd+rKeK2t1EEfXx2hQZbkn4s7wOkurUNPYqUb5Vqq4AG9U7Mrc6MHs+z1yKO7Z 0RCzHTityftwj8J1iM3WybS559+VxRXLg+1aSfg+KqsqAYXP1m0k1SGy96C7p7pbKQJq RoGQ== X-Gm-Message-State: ALoCoQmC8c8+jIZNTQiecDbMhzvon4+3PAV7KAI/ZMh5BAD1AhjawHtZJMC0Xaw+psbX7oCy0OjP X-Received: by 10.66.161.234 with SMTP id xv10mr3234984pab.20.1403199845160; Thu, 19 Jun 2014 10:44:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.46.99 with SMTP id j90ls641706qga.49.gmail; Thu, 19 Jun 2014 10:44:05 -0700 (PDT) X-Received: by 10.221.40.193 with SMTP id tr1mr5173445vcb.31.1403199845054; Thu, 19 Jun 2014 10:44:05 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id n1si2736751vem.71.2014.06.19.10.44.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Jun 2014 10:44:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jw12so2626129veb.39 for ; Thu, 19 Jun 2014 10:44:05 -0700 (PDT) X-Received: by 10.58.69.76 with SMTP id c12mr2978839veu.35.1403199844978; Thu, 19 Jun 2014 10:44:04 -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.221.54.6 with SMTP id vs6csp379390vcb; Thu, 19 Jun 2014 10:44:04 -0700 (PDT) X-Received: by 10.224.162.212 with SMTP id w20mr8113811qax.50.1403199844543; Thu, 19 Jun 2014 10:44:04 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a47si7298921qge.60.2014.06.19.10.44.04 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Jun 2014 10:44:04 -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]:37017 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxgNY-00021Q-6j for patch@linaro.org; Thu, 19 Jun 2014 13:44:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxgGs-0000tY-J5 for qemu-devel@nongnu.org; Thu, 19 Jun 2014 13:37:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxgGr-0004vm-Iw for qemu-devel@nongnu.org; Thu, 19 Jun 2014 13:37:10 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxgGr-0004k9-Cr for qemu-devel@nongnu.org; Thu, 19 Jun 2014 13:37:09 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WxgGf-0002JA-Lp for qemu-devel@nongnu.org; Thu, 19 Jun 2014 18:36:57 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 19 Jun 2014 18:36:46 +0100 Message-Id: <1403199417-8833-4-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1403199417-8833-1-git-send-email-peter.maydell@linaro.org> References: <1403199417-8833-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 03/14] target-arm: Add ULL suffix to calculation of page size 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.128.180 as permitted sender) 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 The maximum block size for AArch64 address translation is 2GB. This means that we need a ULL suffix on our shift to avoid shifting into the sign bit of a signed 32 bit integer. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite Message-id: 1402171881-14343-2-git-send-email-peter.maydell@linaro.org --- 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 12285cd..ed4d2bb 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -3952,7 +3952,7 @@ static int get_phys_addr_lpae(CPUARMState *env, target_ulong address, * These are basically the same thing, although the number * of bits we pull in from the vaddr varies. */ - page_size = (1 << ((granule_sz * (4 - level)) + 3)); + page_size = (1ULL << ((granule_sz * (4 - level)) + 3)); descaddr |= (address & (page_size - 1)); /* Extract attributes from the descriptor and merge with table attrs */ attrs = extract64(descriptor, 2, 10)