[vbox-dev] BIOS "int 0x15, eax = 0xE820" bugs

Brendan Trotter btrotter at gmail.com
Wed Jan 17 10:26:35 GMT 2007


Hi,

I just wanted to report a bug in the BIOS with "int 0x15, eax =
0xE820" (Get System Address Map).

Basically, the ACPI reclaimable area is reported as RAM and as ACPI
reclaimable (i.e. the same area reported twice). It also reports 1 MB
less than it should.

For an example, for a 4 MB guest machine I get a memory map like this:

      0x00000000 to 0x0009FBFF, 639 KiB of usable RAM
      0x0009FC00 to 0x0009FFFF, 1024 B of system area
      0x000F0000 to 0x000FFFFF, 65536 B of system area
*      0x00100000 to 0x002FFFFF, 2048 KiB of usable RAM
*      0x002F0000 to 0x002FFFFF, 65536 B of ACPI reclaimable RAM
      0xFFFC0000 to 0xFFFFFFFF, 256 KiB of system area

What I should get is something like this:

      0x00000000 to 0x0009FBFF, 639 KiB of usable RAM
      0x0009FC00 to 0x0009FFFF, 1024 B of system area
      0x000F0000 to 0x000FFFFF, 65536 B of system area
*     0x00100000 to 0x003EFFFF, 3008 KiB of usable RAM
*     0x003F0000 to 0x003FFFFF, 65536 B of ACPI reclaimable RAM
      0xFFFC0000 to 0xFFFFFFFF, 256 KiB of system area

The end result depends on the OS. AFAIK Linux has special code to
handle buggy BIOSs and will promote an overlapping area to the most
restrictive type (in this case "usable RAM" would be overwritten by
the "ACPI reclaimable" type). My OS pukes and refuses to boot (if I
can't trust the BIOS with something this simple, then I can't trust
the BIOS for much else).

Other OSs may not detect or work-around this bug, conceivable allowing
software failure later on. For example, if my code didn't detect the
problem it'd add the usable RAM to the free page stacks, and then
later on (when the ACPI reclaimable area is reclaimed) it'd add the
same pages to the free page stacks a second time, which allows the
same physical pages to be allocated by seperate independant processes
(where any writes in one process corrupts code/data in another
process).

I have no idea how any other OS (Windows, BSD, Solaris, etc) would behave.

The missing 1 MiB, isn't much of a problem (although I do wonder if
VirtualBox allocates 1 MiB of host RAM that guest OS's never use, and
if it'd cause problems when a PCI device is memory mapped just above
the reported "end of RAM").


Cheers,

Brendan

-- 
BCOS Project - http://bcos.zapto.org




More information about the vbox-dev mailing list