From 980c8629a98c842ef5b1e332d513ba24a82cb331 Mon Sep 17 00:00:00 2001 From: Markus Armbruster <armbru@redhat.com> Date: Wed, 17 Jun 2009 17:57:39 +0200 Subject: [PATCH 1/2] 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> --- bios/rombios32.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bios/rombios32.c b/bios/rombios32.c index b049487..6c03eb3 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) -- 1.6.3.rc4.29.g8146