qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: [Qemu-devel] [PATCH 1/3] target-arm: Add ULL suffix to calculation of page size
Date: Sat,  7 Jun 2014 21:11:19 +0100	[thread overview]
Message-ID: <1402171881-14343-2-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1402171881-14343-1-git-send-email-peter.maydell@linaro.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 <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 ec031f5..cbad223 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -3926,7 +3926,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 */
         if (arm_feature(env, ARM_FEATURE_V8)) {
-- 
1.8.5.4

  reply	other threads:[~2014-06-07 20:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-07 20:11 [Qemu-devel] [PATCH 0/3] target-arm: three minor coverity fixes Peter Maydell
2014-06-07 20:11 ` Peter Maydell [this message]
2014-06-13 23:39   ` [Qemu-devel] [PATCH 1/3] target-arm: Add ULL suffix to calculation of page size Peter Crosthwaite
2014-06-07 20:11 ` [Qemu-devel] [PATCH 2/3] target-arm/translate-a64.c: Remove dead ?: in disas_simd_3same_int() Peter Maydell
2014-06-13 23:49   ` Peter Crosthwaite
2014-06-07 20:11 ` [Qemu-devel] [PATCH 3/3] target-arm/translate-a64.c: Fix dead ?: in handle_simd_shift_fpint_conv() Peter Maydell
2014-06-13 23:52   ` Peter Crosthwaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402171881-14343-2-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=patches@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).