1 bios: Fix multiple calls into smbios_load_ex
3 We're marking the used entry bitmap in smbios_load_external() for each
4 type we check, regardless of whether we loaded anything. This makes
5 subsequent calls behave as if we've already loaded the tables from qemu
6 and can result in missing tables (ex. multiple type4 entries on an SMP
7 guest). Only mark the bitmap if we actually load something.
9 Signed-off-by: Alex Williamson <alex.williamson@hp.com>
10 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 diff --git a/bios/rombios32.c b/bios/rombios32.c
13 index f861f81..c869798 100644
14 --- a/bios/rombios32.c
15 +++ b/bios/rombios32.c
16 @@ -2554,13 +2554,14 @@ smbios_load_external(int type, char **p, unsigned *nr_structs,
17 *max_struct_size = *p - (char *)header;
20 - /* Mark that we've reported on this type */
21 - used_bitmap[(type >> 6) & 0x3] |= (1ULL << (type & 0x3f));
23 + /* Mark that we've reported on this type */
24 + used_bitmap[(type >> 6) & 0x3] |= (1ULL << (type & 0x3f));
28 - return (start != *p);
30 +#endif /* !BX_QEMU */
35 void smbios_init(void)