From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUKzJ-0004mz-6u for qemu-devel@nongnu.org; Mon, 22 Apr 2013 13:57:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUKzE-0002pK-V5 for qemu-devel@nongnu.org; Mon, 22 Apr 2013 13:57:13 -0400 Received: from dmz-mailsec-scanner-6.mit.edu ([18.7.68.35]:57001) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUKzE-0002p7-R9 for qemu-devel@nongnu.org; Mon, 22 Apr 2013 13:57:08 -0400 Date: Mon, 22 Apr 2013 13:57:04 -0400 From: Austin Clements Message-ID: <20130422175704.GW8998@mit.edu> References: <1363301710-19729-1-git-send-email-amdragon@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1363301710-19729-1-git-send-email-amdragon@mit.edu> Subject: Re: [Qemu-devel] [PATCH] multiboot: Clean up mmap loop and report correct mmap_length List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori Ping. I never heard back about this bug fix to the multiboot loader. Quoth myself on Mar 14 at 6:55 pm: > Previously, the multiboot option ROM set the mmap_length field of the > multiboot info structure to the length of the mmap array *excluding* > the final element of the array, rather than the total length of the > array. The multiboot specification indicates that this is incorrect, > and it's incompatible with GRUB's [1] and SYSLINUX's [2] multiboot > loaders, which both set mmap_length to the length of the entire mmap > array. > > This bug is easy to miss: if the VM is configured with 3584 MB of RAM > or less, the last E820 entry is simply a reserved region that does not > overlap with any other region, so there's no harm in omitting it. > However, if it's started with more than 3584 MB of RAM, the memory > above the high memory hole appears as the last entry in the E820 map > and will be omitted from the multiboot mmap array. > > This patch rewrites the loop that constructs the mmap array from the > E820 map to simplify it and fix the final mmap_length value. > > [1] grub-core/loader/i386/multiboot_mbi.c:grub_multiboot_make_mbi > > [2] com32/mboot/mem.c:mboot_make_memmap > > Signed-off-by: Austin Clements > --- > pc-bios/multiboot.bin | Bin 1024 -> 1024 bytes > pc-bios/optionrom/multiboot.S | 25 +++++++++---------------- > 2 files changed, 9 insertions(+), 16 deletions(-)