I'm sorry that I never got around to looking at this, but it turns out the
error message was just meaningless. Essentially, if you ask for more than
3.5G of memory, QEMU leaves a hole between 3.5G and 4.0G and so some extra
logic was required to determine if an address was actually out of bounds.

Anyways, I've written a tiny patch and tested with both 4GB and 8GB and it
appears to be fine now.

-Paul

On Tue, Jan 11, 2011 at 5:43 PM, Jason Clemons <[email protected]> wrote:

> Hi,
>
> I have machine running 64Bit Ubuntu with 8GB or RAM.  When I run simconfig
> after starting qemu with 4096M for memory I get an address out of range
> error during the simulation:
>
> ERROR: guest physical address 0x11fe9fd80 is out of bounds
>
>
> The physical address changes but the error repeats over and over.  Where
> can I set the maximum memory limit for the system under test?
>
>
> Thanks,
>
> Jason Clemons
>
>
> _______________________________________________
> http://www.marss86.org
> Marss86-Devel mailing list
> [email protected]
> https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel
>
From 25939c51b57d379ae5b9098d57db80fd573d387b Mon Sep 17 00:00:00 2001
From: Paul Rosenfeld <[email protected]>
Date: Tue, 15 Feb 2011 10:44:48 -0500
Subject: [PATCH] Fix erroneous error print when running with >3.5GB of memory in QEMU

---
 ptlsim/sim/ptl-qemu.cpp |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ptlsim/sim/ptl-qemu.cpp b/ptlsim/sim/ptl-qemu.cpp
index f6aea4c..3078caa 100644
--- a/ptlsim/sim/ptl-qemu.cpp
+++ b/ptlsim/sim/ptl-qemu.cpp
@@ -828,11 +828,20 @@ redo:
             assert(0);
         }
         if (paddr > qemu_ram_size) {
-            printf("ERROR: guest physical address 0x%llx is out of bounds\n", paddr);
+            if (qemu_ram_size < 0xe0000000 ) {
+                printf("ERROR: guest physical address 0x%llx is out of bounds\n", paddr);
+            } else {
+                // we have a split memory from 0 to 3.5G and from 4G+
+                if (paddr < 0x100000000ULL && paddr > 0xe0000000) { 
+                    // It seems that qemu won't allocate paddrs in this range so warn about it
+                    printf("ERROR: guest physical address 0x%llx is between 3.5GB and 4.0GB\n", paddr);
+                } else if (paddr >= 0x100000000ULL && paddr - (0x100000000ULL-0xe0000000) > qemu_ram_size) {
+                    printf("ERROR: guest physical address 0x%llx is out of bounds\n", paddr);
+                }
+            }
         }
         return paddr;
     }
-
     mmio = 0;
 
     /* Can't find valid TLB entry, its an exception */
-- 
1.7.0.4

_______________________________________________
http://www.marss86.org
Marss86-Devel mailing list
[email protected]
https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel

Reply via email to