Sparc64: replace tsptr with helper routine
[qemu/aliguori-queue.git] / pc-bios / bios-pq / 0019-bios-fix-multiple-calls.patch
blobcfa4c130930f9c6f4a698b9f1b385c5f0d6aea1c
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));
22 + if (start != *p) {
23 + /* Mark that we've reported on this type */
24 + used_bitmap[(type >> 6) & 0x3] |= (1ULL << (type & 0x3f));
25 + return 1;
26 + }
28 - return (start != *p);
29 -#else /* !BX_QEMU */
30 +#endif /* !BX_QEMU */
31 return 0;
32 -#endif
35 void smbios_init(void)