diff mbox

[Bug,1273944] Re: multiboot header has 0 in mem_upper field

Message ID 20140129042749.12626.79571.malone@soybean.canonical.com
State New
Headers show

Commit Message

Peter Chubb Jan. 29, 2014, 4:27 a.m. UTC
This change fixes it.

peterc@Diprotodon:/usr/src/qemu/tests/m

Comments

Peter Chubb Jan. 29, 2014, 10:13 a.m. UTC | #1
>>>>> "Peter" == Peter Chubb <peter.chubb@nicta.com.au> writes:
This change fixes it.

> diff --git a/exec.c b/exec.c
> index 2435d9e..b387d28 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1070,7 +1070,7 @@ static void *file_ram_alloc(RAMBlock *block,
>          }
> 
>          /* MAP_POPULATE silently ignores failures */
> -        for (i = 0; i < (memory/hpagesize); i++) {
> +        for (i = 0; i < (memory/hpagesize)-1; i++) {
>              memset(area + (hpagesize*i), 0, 1);
>          }

I don't know why this fixes the issue.  Hence, no signed-off-by line, etc.

My guess is that the memset zeros something it shouldn't off the end of
the array (but that doesn't make sense to me!)

Peter C
--
Dr Peter Chubb				        peter.chubb AT nicta.com.au
http://www.ssrg.nicta.com.au          Software Systems Research Group/NICTA
diff mbox

Patch

diff --git a/exec.c b/exec.c
index 2435d9e..b387d28 100644
--- a/exec.c
+++ b/exec.c
@@ -1070,7 +1070,7 @@  static void *file_ram_alloc(RAMBlock *block,
         }
 
         /* MAP_POPULATE silently ignores failures */
-        for (i = 0; i < (memory/hpagesize); i++) {
+        for (i = 0; i < (memory/hpagesize)-1; i++) {
             memset(area + (hpagesize*i), 0, 1);
         }