From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOC9N-0006A1-4k for qemu-devel@nongnu.org; Tue, 07 Jul 2009 11:00:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOC9I-00067z-Im for qemu-devel@nongnu.org; Tue, 07 Jul 2009 11:00:04 -0400 Received: from [199.232.76.173] (port=60171 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOC9I-00067t-5q for qemu-devel@nongnu.org; Tue, 07 Jul 2009 11:00:00 -0400 Received: from mail-vw0-f171.google.com ([209.85.212.171]:32859) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOC9H-0005S9-N9 for qemu-devel@nongnu.org; Tue, 07 Jul 2009 10:59:59 -0400 Received: by vwj1 with SMTP id 1so3321949vwj.4 for ; Tue, 07 Jul 2009 07:59:58 -0700 (PDT) MIME-Version: 1.0 Sender: alex.l.williamson@gmail.com In-Reply-To: <1245080492.4851.29.camel@lappy> References: <1245080492.4851.29.camel@lappy> Date: Tue, 7 Jul 2009 08:59:58 -0600 Message-ID: <7162ab20907070759m4aec611dtf4d5b37e615f1e83@mail.gmail.com> Subject: Re: [Qemu-devel] [PATCH RESEND] bios: Fix multiple calls into smbios_load_external() From: Alex Williamson Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: Beth Kon Bump. On Mon, Jun 15, 2009 at 9:41 AM, Alex Williamson wr= ote: > We're marking the used entry bitmap in smbios_load_external() for each > type we check, regardless of whether we loaded anything. =C2=A0This 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). =C2=A0Only mark the bitmap if we actually load something. > > Signed-off-by: Alex Williamson > -- > > diff --git a/bios/rombios32.c b/bios/rombios32.c > index f861f81..c869798 100644 > --- a/bios/rombios32.c > +++ b/bios/rombios32.c > @@ -2554,13 +2554,14 @@ smbios_load_external(int type, char **p, unsigned= *nr_structs, > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *max_struct_size =3D *p - (char= *)header; > =C2=A0 =C2=A0 } > > - =C2=A0 =C2=A0/* Mark that we've reported on this type */ > - =C2=A0 =C2=A0used_bitmap[(type >> 6) & 0x3] |=3D (1ULL << (type & 0x3f)= ); > + =C2=A0 =C2=A0if (start !=3D *p) { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Mark that we've reported on this type */ > + =C2=A0 =C2=A0 =C2=A0 =C2=A0used_bitmap[(type >> 6) & 0x3] |=3D (1ULL <<= (type & 0x3f)); > + =C2=A0 =C2=A0 =C2=A0 =C2=A0return 1; > + =C2=A0 =C2=A0} > > - =C2=A0 =C2=A0return (start !=3D *p); > -#else /* !BX_QEMU */ > +#endif /* !BX_QEMU */ > =C2=A0 =C2=A0 return 0; > -#endif > =C2=A0} > > =C2=A0void smbios_init(void) > > > > >