summaryrefslogtreecommitdiff
path: root/bios
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2009-06-17 17:57:39 +0200
committerEduardo Habkost <ehabkost@redhat.com>2009-06-19 14:54:11 -0300
commit980c8629a98c842ef5b1e332d513ba24a82cb331 (patch)
tree898150e78358ce6c8324ef2fcbde4dd7e7fc4520 /bios
parentd471977de32e331ed49e3c53f404b9dc815097e7 (diff)
bios: Fix missing DMI table entries
Upstream qemu-kvm commit 12766cd6 can make the BIOS to swallow DMI table entries. I observed it swallowing one of two CPUs by booting from RHEL-3.8 installation media and running dmidecode. With the patch applied, dmidecode shows both CPUs again. Patch snatched from qemu-devel, where it has been ignored so far (I posted a nudge): From: Alex Williamson <alex.williamson@hp.com> Subject: [Qemu-devel] [PATCH RESEND] bios: Fix multiple calls into smbios_load_external() To: qemu-devel <qemu-devel@nongnu.org> Cc: Beth Kon <eak@us.ibm.com> Date: Mon, 15 Jun 2009 09:41:32 -0600 Message-Id: <1243528568.25164.47.camel@bling> Organization: OSLO R&D 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> Bug 504713, please ACK. Message-ID: <87skhy6efg.fsf@pike.pond.sub.org> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Bugzilla: 504713 RH-Upstream-status: submitted(qemu-devel) Acked-by: Zachary Amsden <zamsden@redhat.com> Acked-by: Avi Kivity <avi@redhat.com> Acked-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'bios')
-rwxr-xr-xbios/rombios32.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bios/rombios32.c b/bios/rombios32.c
index b0494873..6c03eb3c 100755
--- a/bios/rombios32.c
+++ b/bios/rombios32.c
@@ -2276,13 +2276,14 @@ smbios_load_external(int type, char **p, unsigned *nr_structs,
*max_struct_size = *p - (char *)header;
}
- /* Mark that we've reported on this type */
- used_bitmap[(type >> 6) & 0x3] |= (1ULL << (type & 0x3f));
+ if (start != *p) {
+ /* Mark that we've reported on this type */
+ used_bitmap[(type >> 6) & 0x3] |= (1ULL << (type & 0x3f));
+ return 1;
+ }
- return (start != *p);
-#else /* !BX_QEMU */
+#endif /* !BX_QEMU */
return 0;
-#endif
}
void smbios_init(void)