From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LP6Q0-00086I-7B for qemu-devel@nongnu.org; Mon, 19 Jan 2009 21:32:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LP6Pz-00085Z-05 for qemu-devel@nongnu.org; Mon, 19 Jan 2009 21:32:43 -0500 Received: from [199.232.76.173] (port=56951 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LP6Py-00085T-Mm for qemu-devel@nongnu.org; Mon, 19 Jan 2009 21:32:42 -0500 Received: from mx2.redhat.com ([66.187.237.31]:39289) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LP6Py-0001Np-9f for qemu-devel@nongnu.org; Mon, 19 Jan 2009 21:32:42 -0500 Message-Id: <20090120023057.503063308@amt.cnet> Date: Tue, 20 Jan 2009 00:30:41 -0200 From: Marcelo Tosatti References: <20090120023040.623163208@amt.cnet> Content-Disposition: inline; filename=0002_smbios_report_4g.patch Subject: [Qemu-devel] [patch 1/9] kvm: bios: update SMBIOS table to report memory above 4G Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, bochs-developers@lists.sourceforge.net Cc: Anthony Liguori , Avi Kivity , Alex Williamson Signed-off-by: Alex Williamson Signed-off-by: Avi Kivity From: Alex Williamson Index: bochs/bios/rombios32.c =================================================================== --- bochs.orig/bios/rombios32.c +++ bochs/bios/rombios32.c @@ -2081,7 +2081,8 @@ void smbios_init(void) { unsigned cpu_num, nr_structs = 0, max_struct_size = 0; char *start, *p, *q; - int memsize = ram_size / (1024 * 1024); + int memsize = (ram_end == ram_size) ? ram_size / (1024 * 1024) : + (ram_end - (1ull << 32) + ram_size) / (1024 * 1024); #ifdef BX_USE_EBDA_TABLES ebda_cur_addr = align(ebda_cur_addr, 16); @@ -2108,8 +2109,8 @@ void smbios_init(void) add_struct(smbios_type_4_init(p, cpu_num)); add_struct(smbios_type_16_init(p, memsize)); add_struct(smbios_type_17_init(p, memsize)); - add_struct(smbios_type_19_init(p, memsize)); - add_struct(smbios_type_20_init(p, memsize)); + add_struct(smbios_type_19_init(p, ram_end / (1024 * 1024))); + add_struct(smbios_type_20_init(p, ram_end / (1024 * 1024))); add_struct(smbios_type_32_init(p)); add_struct(smbios_type_127_init(p));