multiboot header has 0 in mem_upper field

Bug #1273944 reported by Peter Chubb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Expired
Undecided
Unassigned

Bug Description

When booting a multiboot image,. mem_upper is now always zero.

To test, build qemu from current git head, then do
  cd tests/multiboot
  ./run_test.sh

You will see the test fail. In each case mem_upper is 0k.

git-bisect says the bad commit is 0169c511554cb0014a00290b0d3d26c31a49818f in qemu.git

Revision history for this message
Peter Chubb (peter-chubb-1) wrote :

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);
         }

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

Revision history for this message
Peter Chubb (peter-chubb-1) wrote : Re: [Qemu-devel] [Bug 1273944] Re: multiboot header has 0 in mem_upper field

>>>>> "Peter" == Peter Chubb <email address hidden> 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

Revision history for this message
Thomas Huth (th-huth) wrote :

tests/multiboot seems to work with current git again, so I assume this issue has been fixed? Or is there something left to do?

Changed in qemu:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for QEMU because there has been no activity for 60 days.]

Changed in qemu:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.