From b3e58577b9d44306d26a4ba56a8f7044b82485c0 Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Thu, 25 Sep 2008 11:52:21 -0600 Subject: [PATCH] kvm: bios: update SMBIOS table to report memory above 4G kvm: bios: update SMBIOS table to report memory above 4G Signed-off-by: Alex Williamson Signed-off-by: Avi Kivity --- kvm/bios/rombios32.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kvm/bios/rombios32.c b/kvm/bios/rombios32.c index bb33cb3446..a0c1774df2 100755 --- a/kvm/bios/rombios32.c +++ b/kvm/bios/rombios32.c @@ -2045,7 +2045,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); @@ -2072,8 +2073,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)); -- 2.11.4.GIT