|
|
1.1 root 1: bios: Fix multiple calls into smbios_load_ex
2:
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.
8:
9: Signed-off-by: Alex Williamson <[email protected]>
10: Signed-off-by: Anthony Liguori <[email protected]>
11:
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;
18: }
19:
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: + }
27:
28: - return (start != *p);
29: -#else /* !BX_QEMU */
30: +#endif /* !BX_QEMU */
31: return 0;
32: -#endif
33: }
34:
35: void smbios_init(void)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.