From: Alex Williamson Subject: [PATCH 3/5] bios: update SMBIOS table to report memory above 4G Date: Tue, 23 Sep 2008 10:42:21 -0600 Message-ID: <1222188141.8138.104.camel@2710p.home> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Avi Kivity To: kvm-devel Return-path: Received: from g5t0008.atlanta.hp.com ([15.192.0.45]:31360 "EHLO g5t0008.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752339AbYIWQmZ (ORCPT ); Tue, 23 Sep 2008 12:42:25 -0400 Sender: kvm-owner@vger.kernel.org List-ID: kvm: bios: update SMBIOS table to report memory above 4G Signed-off-by: Alex Williamson --- bios/rombios32.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bios/rombios32.c b/bios/rombios32.c index 4821ec4..c515d4a 100755 --- a/bios/rombios32.c +++ b/bios/rombios32.c @@ -2023,7 +2023,8 @@ void smbios_init(void) { unsigned cpu_num, nr_structs = 0, max_struct_size = 0; char *start, *p, *q; - int memsize = low_ram_size / (1024 * 1024); + int memsize = (mem_top == low_ram_size) ? low_ram_size / (1024 * 1024) : + (mem_top - (1ull << 32) + low_ram_size) / (1024 * 1024); #ifdef BX_USE_EBDA_TABLES ebda_cur_addr = align(ebda_cur_addr, 16); @@ -2050,8 +2051,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, mem_top / (1024 * 1024))); + add_struct(smbios_type_20_init(p, mem_top / (1024 * 1024))); add_struct(smbios_type_32_init(p)); add_struct(smbios_type_127_init(p));