From mboxrd@z Thu Jan 1 00:00:00 1970 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 Date: Thu, 19 Jun 2014 18:36:46 +0100 Message-Id: <1403199417-8833-4-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1403199417-8833-1-git-send-email-peter.maydell@linaro.org> References: <1403199417-8833-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 03/14] target-arm: Add ULL suffix to calculation of page size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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) -- 1.9.2