Commit e1e8f35a4f59d82ab9a5361c3990c8dadd2e7678

Authored by Anthony Liguori
1 parent 84273177

bios: Fix multiple calls into smbios_load_ex

We're marking the used entry bitmap in smbios_load_external() for each
type we check, regardless of whether we loaded anything.  This makes
subsequent calls behave as if we've already loaded the tables from qemu
and can result in missing tables (ex. multiple type4 entries on an SMP
guest).  Only mark the bitmap if we actually load something.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc-bios/bios-pq/0019-bios-fix-multiple-calls.patch 0 → 100644
  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 <alex.williamson@hp.com>
  10 +Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  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)
pc-bios/bios-pq/series
@@ -16,3 +16,4 @@ @@ -16,3 +16,4 @@
16 0016-use-correct-mask-to-size-pci-option-rom-bar.patch 16 0016-use-correct-mask-to-size-pci-option-rom-bar.patch
17 0017-bochs-bios-Move-QEMU_CFG-constants-to-rombios.h.patch 17 0017-bochs-bios-Move-QEMU_CFG-constants-to-rombios.h.patch
18 0018-bochs-bios-Make-boot-prompt-optional.patch 18 0018-bochs-bios-Make-boot-prompt-optional.patch
  19 +0019-bios-fix-multiple-calls.patch
pc-bios/bios.bin
No preview for this file type