ia64/xen-unstable

changeset 19028:95d8788bf4be

hvmloader: Fix SMBIOS memory device length boundary condition.

dev_memsize ends up 0 when it shouldn't be on 16G boundary conditions.

Signed-off-by: Bill Rieske <brieske@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Jan 12 10:23:55 2009 +0000 (2009-01-12)
parents 59d511c4a8d8
children 5ad9fc3c896f
files tools/firmware/hvmloader/smbios.c
line diff
     1.1 --- a/tools/firmware/hvmloader/smbios.c	Mon Jan 12 10:17:12 2009 +0000
     1.2 +++ b/tools/firmware/hvmloader/smbios.c	Mon Jan 12 10:23:55 2009 +0000
     1.3 @@ -118,8 +118,9 @@ write_smbios_tables(void *start,
     1.4      do_struct(smbios_type_16_init(p, memsize, nr_mem_devs));
     1.5      for ( i = 0; i < nr_mem_devs; i++ )
     1.6      {
     1.7 -        uint32_t dev_memsize = ((i == (nr_mem_devs - 1))
     1.8 -                                ? (memsize & 0x3fff) : 0x4000);
     1.9 +        uint32_t dev_memsize = 0x4000; /* all but last covers 16GB */
    1.10 +        if ( (i == (nr_mem_devs - 1)) && ((memsize & 0x3fff) != 0) )
    1.11 +            dev_memsize = memsize & 0x3fff; /* last dev is <16GB */
    1.12          do_struct(smbios_type_17_init(p, dev_memsize, i));
    1.13          do_struct(smbios_type_19_init(p, dev_memsize, i));
    1.14          do_struct(smbios_type_20_init(p, dev_memsize, i));