summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@hp.com>2008-09-25 11:52:21 -0600
committerAvi Kivity <avi@redhat.com>2008-10-02 15:33:33 +0300
commit6b5acda94ab0cd906aeb8beb2bf2a96def301910 (patch)
treeb4f8d8b4d4b5a85671994792ecbd6dcbced3ba33
parent1fb73013fd17f960e595ef899142ddeaadcf70b3 (diff)
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 <alex.williamson@hp.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rwxr-xr-xbios/rombios32.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bios/rombios32.c b/bios/rombios32.c
index bb33cb34..a0c1774d 100755
--- a/bios/rombios32.c
+++ b/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));