From: Tim Deegan Date: Fri, 5 Jan 2007 16:28:42 +0000 (+0000) Subject: [HVM] Sync the base memory reported by ROMBIOS with the e820 map. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15422^2~63 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5c6059a43d2b65f653d18c9ffc795c1ee281e05e;p=xen.git [HVM] Sync the base memory reported by ROMBIOS with the e820 map. This stops Etherboot relocating itself onto the SMBIOS tables. Signed-off-by: Tim Deegan --- diff --git a/tools/firmware/rombios/rombios.c b/tools/firmware/rombios/rombios.c index 7a14b46ac4..edbc0cc528 100644 --- a/tools/firmware/rombios/rombios.c +++ b/tools/firmware/rombios/rombios.c @@ -1435,10 +1435,17 @@ void copy_e820_table() { Bit8u nr_entries = read_byte(0x9000, 0x1e8); + Bit32u base_mem; if (nr_entries > 32) nr_entries = 32; write_word(0xe000, 0x8, nr_entries); memcpyb(0xe000, 0x10, 0x9000, 0x2d0, nr_entries * 0x14); + /* Report the proper base memory size at address 0x0413: otherwise + * non-e820 code will clobber things if BASE_MEM_IN_K is bigger than + * the first e820 entry. Get the size by reading the second 64bit + * field of the first e820 slot. */ + base_mem = read_dword(0x9000, 0x2d0 + 8); + write_word(0x40, 0x13, base_mem >> 10); } #endif /* HVMASSIST */