From nobody Mon Feb 9 10:53:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+84212+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84212+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1638369046; cv=none; d=zohomail.com; s=zohoarc; b=Anhv0Aut1pANWCAYQ8aBoz8v7vDc2LGqwAspSwlDKTVp6vwFwPZ7NNxXLchvrwRYZYCxPS9RvS4QRYZhHu1JyzN9LTsozoBLOIksJNCMcna3x3aaJWffpW8xhCfIbPqK6cOIU+a8GWRQWFe4OlGqgawDbpVVI7o4vGI5fKfMxhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638369046; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=h1ON0Ff/cfggPBE/FmjUVS9ly1oEps9h1vWKIn7wSWk=; b=cSsrKv7EeFMkS3aOJD3c2XjyJn46PFJqdNLgXuTKd5C/Kj1HJWUvhbLVaOCmSsqF6z++/jROw1Ws8HvFC1dWhe4n3kVm+Zz8mxfPoGUUAeLxFKjxYq1IUzt/OXQ5SKRiiSVOix3Vn+mlPiJTm1Ic1V75wPiq3qFi5RJIDtHTh5w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84212+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1638369046397194.70738551386273; Wed, 1 Dec 2021 06:30:46 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id HZ7qYY1788612xWfBtfxSyyu; Wed, 01 Dec 2021 06:30:46 -0800 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.91141.1638360146736469616 for ; Wed, 01 Dec 2021 04:02:27 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10184"; a="236671917" X-IronPort-AV: E=Sophos;i="5.87,278,1631602800"; d="scan'208";a="236671917" X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2021 04:02:26 -0800 X-IronPort-AV: E=Sophos;i="5.87,278,1631602800"; d="scan'208";a="596307005" X-Received: from rshussey-mobl1.ger.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.26.82]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2021 04:02:24 -0800 From: sebastien.boeuf@intel.com To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [edk2-devel] [PATCH 2/5] OvmfPkg: Create global entry point for SMBIOS parsing Date: Wed, 1 Dec 2021 13:01:45 +0100 Message-Id: <2d3f6b15c1b6a944869cab87858e108a6131fe86.1638351613.git.sebastien.boeuf@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sebastien.boeuf@intel.com X-Gm-Message-State: 9CP66H3T2Q846NDiXSmKQ11ex1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1638369046; bh=eySQfbzNOVq25CiVrV1sZex91Kvw9tYnQbPLaXjBsY4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=W/MIr9RkW9bnOX1k2zmh54lZgdveEtrwqo8R/qXclTNigmIu1+Lm6ffOMmEF9Xh3qFI Gkl6zNKYjl+vqGvGaAeX9cU+CyE4iLgr4zDWhRT4YZGGOSwkfYwsgUmYASsXMjFVBT3av duewMhWuANbFi2x7MN5EzKPVg2TdLLGpCMY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1638369048023100005 Content-Type: text/plain; charset="utf-8" From: Sebastien Boeuf Move the generic entry point part out of Qemu.c to anticipate the addition of new ways of retrieving the SMBIOS table. Signed-off-by: Sebastien Boeuf --- OvmfPkg/SmbiosPlatformDxe/EntryPoint.c | 47 +++++++++++++++++++ OvmfPkg/SmbiosPlatformDxe/Qemu.c | 35 -------------- .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 1 + 3 files changed, 48 insertions(+), 35 deletions(-) create mode 100644 OvmfPkg/SmbiosPlatformDxe/EntryPoint.c diff --git a/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c b/OvmfPkg/SmbiosPlatfor= mDxe/EntryPoint.c new file mode 100644 index 0000000000..d3b1836a04 --- /dev/null +++ b/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c @@ -0,0 +1,47 @@ +/** @file + Find and extract SMBIOS data. + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include // FreePool() + +#include "SmbiosPlatformDxe.h" + +UINT8 * +GetQemuSmbiosTables ( + VOID + ); + +/** + Installs SMBIOS information for OVMF + + @param ImageHandle Module's image handle + @param SystemTable Pointer of EFI_SYSTEM_TABLE + + @retval EFI_SUCCESS Smbios data successfully installed + @retval Other Smbios data was not installed + +**/ +EFI_STATUS +EFIAPI +SmbiosTablePublishEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + UINT8 *SmbiosTables; + + Status =3D EFI_NOT_FOUND; + // + // Add QEMU SMBIOS data if found + // + SmbiosTables =3D GetQemuSmbiosTables (); + if (SmbiosTables !=3D NULL) { + Status =3D InstallAllStructures (SmbiosTables); + FreePool (SmbiosTables); + } + + return Status; +} diff --git a/OvmfPkg/SmbiosPlatformDxe/Qemu.c b/OvmfPkg/SmbiosPlatformDxe/Q= emu.c index a668c6ac21..56e720aa08 100644 --- a/OvmfPkg/SmbiosPlatformDxe/Qemu.c +++ b/OvmfPkg/SmbiosPlatformDxe/Qemu.c @@ -11,8 +11,6 @@ #include // PcdGetBool() #include // QemuFwCfgFindFile() =20 -#include "SmbiosPlatformDxe.h" - /** Locates and extracts the QEMU SMBIOS data if present in fw_cfg =20 @@ -48,36 +46,3 @@ GetQemuSmbiosTables ( =20 return QemuTables; } - -/** - Installs SMBIOS information for OVMF - - @param ImageHandle Module's image handle - @param SystemTable Pointer of EFI_SYSTEM_TABLE - - @retval EFI_SUCCESS Smbios data successfully installed - @retval Other Smbios data was not installed - -**/ -EFI_STATUS -EFIAPI -SmbiosTablePublishEntry ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - UINT8 *SmbiosTables; - - Status =3D EFI_NOT_FOUND; - // - // Add QEMU SMBIOS data if found - // - SmbiosTables =3D GetQemuSmbiosTables (); - if (SmbiosTables !=3D NULL) { - Status =3D InstallAllStructures (SmbiosTables); - FreePool (SmbiosTables); - } - - return Status; -} diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/Smbi= osPlatformDxe/SmbiosPlatformDxe.inf index eaee73110d..e239a631f2 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -24,6 +24,7 @@ # =20 [Sources] + EntryPoint.c Qemu.c SmbiosPlatformDxe.c SmbiosPlatformDxe.h --=20 2.30.2 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris,=20 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84212): https://edk2.groups.io/g/devel/message/84212 Mute This Topic: https://groups.io/mt/87429205/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-