qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jindrich Makovicka <makovick@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] constant truncation warning in hw/pc.c for 32bit targets
Date: Sun, 28 Sep 2008 14:44:29 +0200	[thread overview]
Message-ID: <20080928144429.5781982d@holly> (raw)

Hi,

for 32bit targets, the 0x100000000ULL start address of above-4G memory
is truncated to zero. IMO the code for above-4G allocation could be
#ifdef'ed only for 64 bit targets, as for 32bit it 1) miscompiles and
2) won't be used anyway:

Index: hw/pc.c
===================================================================
--- hw/pc.c     (revision 5338)
+++ hw/pc.c     (working copy)
@@ -747,7 +747,9 @@
     BlockDriverState *fd[MAX_FD];
 
     if (ram_size >= 0xe0000000 ) {
+#if TARGET_PHYS_ADDR_BITS == 64
         above_4g_mem_size = ram_size - 0xe0000000;
+#endif
         below_4g_mem_size = 0xe0000000;
     } else {
         below_4g_mem_size = ram_size;
@@ -798,6 +800,7 @@
                  below_4g_mem_size - 0x100000,
                  ram_addr);
 
+#if TARGET_PHYS_ADDR_BITS == 64
     /* above 4giga memory allocation */
     if (above_4g_mem_size > 0) {
         ram_addr = qemu_ram_alloc(above_4g_mem_size);
@@ -805,6 +808,7 @@
                                      above_4g_mem_size,
                                      ram_addr);
     }
+#endif
 
 
     /* allocate VGA RAM */


Regards,
-- 
Jindrich Makovicka

             reply	other threads:[~2008-09-28 12:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-28 12:44 Jindrich Makovicka [this message]
2008-09-28 13:52 ` [Qemu-devel] constant truncation warning in hw/pc.c for 32bit targets Blue Swirl
2008-09-28 19:29   ` [Qemu-devel] " Jindrich Makovicka

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=20080928144429.5781982d@holly \
    --to=makovick@gmail.com \
    --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).