From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) by mx.groups.io with SMTP id smtpd.web10.4232.1614760690672607006 for ; Wed, 03 Mar 2021 00:38:10 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@9elements.com header.s=google header.b=DfkRcLuC; spf=pass (domain: 9elements.com, ip: 209.85.161.52, mailfrom: patrick.rudolph@9elements.com) Received: by mail-oo1-f52.google.com with SMTP id n19so5476882ooj.11 for ; Wed, 03 Mar 2021 00:38:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bESOW0xKlI+/9/KrQungH7c5KJbrxvSgeUageSxcqCo=; b=DfkRcLuCDNmWAtGeEL0yIcTd89t1oLoj0EYfRmiWR7VvjPRZLuER5QFSuDL/Imf+cB Be4syt7DdbuGjigFHerhczTYAT6rpg7RvW5iunKpCKWGuZTkUZpJrYlmkHo9zDy9qp0x ceBmmYifeSJs1ErF71COJK9ylw6QaUZv/TGs3/J0J+lttVCorovJekNT+N13luTvwUKk sw4tGGfIIXSRSb/MpIMyDiDV6azslck5FjS0iFWHivYAiSZyVa0IrSP70/CB98pZ1Tjb biDugd1+nXw7CXVYW1rBc/YHtJHA1je0do8PCPZtdEiyiaFS4g50H2uA6b8qJC1HpGYt U4qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bESOW0xKlI+/9/KrQungH7c5KJbrxvSgeUageSxcqCo=; b=YWB81bxoQ5BB2r/VrmViKucRslvU+xvkHRIQRbd1fMvHO7aB4yDhdc7mkq+U1AZPJP q5SgViHYZBcUJKLiuxvbObddRF2RUFak1D2e4pKw5lHZdtloCvG3gSVyGpVW987ZYEKq DSGd6obBBibn+RGpSnZRfdp0XMbDO6BO8uK7kJLmsUa/K387OLcektdNwmz5XajUo8px h4G1G5Oa6wvIRlKw5MvpKt6NtJUnH6NRP8eIxidIxqIVokdMfEavzXbHsIM/NnvS/sTI JKm8FS6Fem0sJRd+lB8PoWOzK/BzHN8uDAuRBNxligfn0a5P5Ld7TDzogbPSGK5DbU9Q yAhQ== X-Gm-Message-State: AOAM530RDnCC+erLyIwl6HYekrdRXnPopPxYm0E/4Qnec6+s7eCDouVJ kz0Ey/qrQKNYMjfP9jVTdPyiRBZaa9NLOZ8LmXnByA== X-Google-Smtp-Source: ABdhPJwu+BsdMKUFL14dP1fwI0to5Bfy/UpPqShpyqUPG8177VVth98foKsivWmOHVzeU5wWfpXiGE/CeVrWzw+j80w= X-Received: by 2002:a4a:858c:: with SMTP id t12mr20253605ooh.20.1614760689925; Wed, 03 Mar 2021 00:38:09 -0800 (PST) MIME-Version: 1.0 References: <20210301143221.2775162-1-patrick.rudolph@9elements.com> In-Reply-To: From: "Patrick Rudolph" Date: Wed, 3 Mar 2021 09:37:59 +0100 Message-ID: Subject: Re: [edk2-devel] [PATCH - resend] MdeModulePkg/Universal/SmbiosDxe: Scan for existing tables To: "Ni, Ray" Cc: "devel@edk2.groups.io" , "Chaganty, Rangasai V" , "Bi, Dandan" , "Zeng, Star" , "Gao, Zhichao" , "You, Benjamin" , "philipp.deppenwiese@9elements.com" , "Ma, Maurice" , "Dong, Guo" Content-Type: text/plain; charset="UTF-8" Hi Ray, thanks for your feedback. Currently a single HOB containing all the SMBIOS table is exported by coreboot. As coreboot doesn't support multiple HOBs with the same ID, #2 isn't a solution. I'll look into passing a HOB instead of using EfiGetSystemConfigurationTable and see if I can get rid of the table shadow copy. Regards, Patrick Rudolph On Wed, Mar 3, 2021 at 9:13 AM Ni, Ray wrote: > > In general, I agree this solution that lets SMBIOS driver directly absorbs the SMBIOS table from PEI. > This can eliminate the needs of a separate driver that consumes the HOB and calls SMBIOS protocol to add the SMBIOS structures. > > There are two options for the HOB design: > 1. A single HOB that points to the SMBIOS table. > 2. Multiple HOBs that each points to a SMBIOS structure. > > In my opinion, option #2 is more flexible because it doesn't require the bootloader to consolidate all the SMBIOS structures together. > The CPU module in the bootloader can produce the type 4 and 7 structures. > The PCI module in the bootloader can produce the type 9 structures. > > But, I am not sure if option #2 is conflict with what coreboot does. Does coreboot produce the whole SMBIOS table in a single buffer? > Option #2 also doesn't care whether it's a SMBIOS 3.0 table or 2.x table. > > >+ Status = EfiGetSystemConfigurationTable ( > > 1. Why don't you directly get the data from HOB list? This can eliminate the code in BlSupportDxe that gets data in HOB and publishes to > configuration table. > > > +ValidateSmbios20Table( > > +ValidateSmbios30Table( > > 2. I will defer to experts (Dandan, Star and Zhichao) to review whether the above two functions are implemented properly. > > > > > +ParseAndAddExistingSmbiosTable( > > + IN EFI_HANDLE ImageHandle, > > + IN SMBIOS_STRUCTURE_POINTER Smbios, > > + IN UINTN Length > > +) { > > + EFI_STATUS Status; > > + CHAR8 *String; > > + EFI_SMBIOS_HANDLE SmbiosHandle; > > + SMBIOS_STRUCTURE_POINTER SmbiosEnd; > > + > > + SmbiosEnd.Raw = Smbios.Raw + Length; > > + > > + do { > > + // Check for end marker > > + if (Smbios.Hdr->Type == 127) { > > 3. Please use SMBIOS_TYPE_END_OF_TABLE instead of hardcode 127. > > > > > + CopyMem (Smbios.Raw, (VOID *)Smbios30Table, Smbios30Table- > > >TableMaximumSize); > > 4. Should we copy from Smbios30Table->TableAddress instead of Smbios30Table? > > > > > + Status = ParseAndAddExistingSmbiosTable(ImageHandle, Smbios, > > Smbios30Table->TableMaximumSize); > > 5. Can you explain in specific why SMBIOS table should be duplicated before parsing? > >