From nobody Mon Feb 9 16:54:18 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+89955+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+89955+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1653285364; cv=none; d=zohomail.com; s=zohoarc; b=eFfyxQcJ9w62Suy2SRJcfwSd1nhRqGCSHl9v063OXeS2VqPyim9tFG/cCclsQWYZ1mRLGO43Ww/+uFpov+6UwdRx7c+UDXZkHUJrxfKjmdbRY5mbv5LN9DoNYa2Ihuil00Pb/Vb4Vov1vKBchOpTg6fLokA170wH0eO8o0pHcSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653285364; h=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=a7L8D+GiX7v5/JHIui5jp8ihyqPLDLzfoOoBNWMBeyk=; b=b5TAY+vQhWi9q2XgZTmNLE0dYtNnmy4P2ZPm29PLXk9wu/bcAp2gsoiVqt/k/JaxXV8fDaYn87K5BB+n9uWwCu7uvXrDpoY7cgqxGeUECjpqmI25eL2DrSIQ21gkuAY/f5d+TdcKG5yl6JMSI0O6cHqNohRh+7sjF3NBTDPJ8bs= 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+89955+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 1653285364546502.78841558918384; Sun, 22 May 2022 22:56:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Q4d2YY1788612xZmRU4mPLt2; Sun, 22 May 2022 22:56:04 -0700 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.24058.1653285360652591392 for ; Sun, 22 May 2022 22:56:03 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="272833036" X-IronPort-AV: E=Sophos;i="5.91,245,1647327600"; d="scan'208";a="272833036" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 22:56:02 -0700 X-IronPort-AV: E=Sophos;i="5.91,245,1647327600"; d="scan'208";a="600459704" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.174.148]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 22:55:59 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Ard Biesheuvel , Jordan Justen , Ashish Kalra , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Sami Mujawar , Gerd Hoffmann Subject: [edk2-devel] [PATCH 1/4] OvmfPkg: Add library class BlobMeasurementLib with null implementation Date: Mon, 23 May 2022 13:55:39 +0800 Message-Id: <23b823d3e53725efb2f6b290973d905a7a020e34.1653284206.git.min.m.xu@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,min.m.xu@intel.com X-Gm-Message-State: OPY32pS1eABnpWnpFUyPG50ix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653285364; bh=9TDHYgwiwQzZHOyr0xDwk9g4xmsUubk6TifBxLRvw5M=; h=Cc:Date:From:Reply-To:Subject:To; b=MO96j9M336iSN0e87NCN3M0OVS15wD+7j5cjCCxDJkn93dM6QgGysDtdpj+J2ttDe2i oODFzRLKHdE0X2FNjO3/oYJ5WYOnxDLg6CSZCKb+pH3PUOyMxyD2HJyJro7hUTmnSYvkb WQzlKKvUfyLA68Vbobq94NJ0LXIV9H11k2o= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653285365065100004 Content-Type: text/plain; charset="utf-8" BlobMeasurementLib will be used to measure blobs fetching from QEMU's firmware config (fw_cfg) in platforms which implments EFI_CC_MEASUREMENT_PROTOCOL. The null implementation BlobMeasurementLibNull always return EFI_SUCCESS. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Ashish Kalra Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Sami Mujawar Cc: Gerd Hoffmann Signed-off-by: Min Xu --- OvmfPkg/Include/Library/BlobMeasurementLib.h | 38 +++++++++++++++++++ .../BlobMeasurementLibNull.c | 34 +++++++++++++++++ .../BlobMeasurementLibNull.inf | 24 ++++++++++++ OvmfPkg/OvmfPkg.dec | 3 ++ 4 files changed, 99 insertions(+) create mode 100644 OvmfPkg/Include/Library/BlobMeasurementLib.h create mode 100644 OvmfPkg/Library/BlobMeasurementLibNull/BlobMeasurementL= ibNull.c create mode 100644 OvmfPkg/Library/BlobMeasurementLibNull/BlobMeasurementL= ibNull.inf diff --git a/OvmfPkg/Include/Library/BlobMeasurementLib.h b/OvmfPkg/Include= /Library/BlobMeasurementLib.h new file mode 100644 index 000000000000..e54a41c2c9c1 --- /dev/null +++ b/OvmfPkg/Include/Library/BlobMeasurementLib.h @@ -0,0 +1,38 @@ +/** @file + + Blob measurement library + + This library class allows measuring blobs from external sources, such as= QEMU's firmware config. + + Copyright (C) 2022, Intel Corporation. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef BLOB_MEASUREMENT_LIB_H_ +#define BLOB_MEASUREMENT_LIB_H_ + +#include +#include + +/** + Measure blob from an external source. + + @param[in] BlobName The name of the blob + @param[in] BlobNameSize Size of the blob name + @param[in] BlobBase The data of the blob + @param[in] BlobSize The size of the blob in bytes + + @retval EFI_SUCCESS The blob was measured successfully. + @retval Other errors +**/ +EFI_STATUS +EFIAPI +MeasureKernelBlob ( + IN CONST CHAR16 *BlobName, + IN UINT32 BlobNameSize, + IN CONST VOID *BlobBase, + IN UINT32 BlobSize + ); + +#endif diff --git a/OvmfPkg/Library/BlobMeasurementLibNull/BlobMeasurementLibNull.= c b/OvmfPkg/Library/BlobMeasurementLibNull/BlobMeasurementLibNull.c new file mode 100644 index 000000000000..e93e3cf164c0 --- /dev/null +++ b/OvmfPkg/Library/BlobMeasurementLibNull/BlobMeasurementLibNull.c @@ -0,0 +1,34 @@ +/** @file + + Null implementation of the blob measurement library. + + Copyright (C) 2022, Intel Corporation. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include + +/** + Measure blob from an external source. + + @param[in] BlobName The name of the blob + @param[in] BlobNameSize Size of the blob name + @param[in] BlobBase The data of the blob + @param[in] BlobSize The size of the blob in bytes + + @retval EFI_SUCCESS The blob was measured successfully. + @retval Other errors +**/ +EFI_STATUS +EFIAPI +MeasureKernelBlob ( + IN CONST CHAR16 *BlobName, + IN UINT32 BlobNameSize, + IN CONST VOID *BlobBase, + IN UINT32 BlobSize + ) +{ + return EFI_SUCCESS; +} diff --git a/OvmfPkg/Library/BlobMeasurementLibNull/BlobMeasurementLibNull.= inf b/OvmfPkg/Library/BlobMeasurementLibNull/BlobMeasurementLibNull.inf new file mode 100644 index 000000000000..5bf3710222c2 --- /dev/null +++ b/OvmfPkg/Library/BlobMeasurementLibNull/BlobMeasurementLibNull.inf @@ -0,0 +1,24 @@ +## @file +# +# Null implementation of the blob measurement library. +# +# Copyright (C) 2022, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D BlobMeasurementLibNull + FILE_GUID =3D fad119ff-8627-4661-a35f-920a6eeb2866 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D BlobMeasurementLib + +[Sources] + BlobMeasurementLibNull.c + +[Packages] + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec index 8c2048051bea..da94e4c7aa89 100644 --- a/OvmfPkg/OvmfPkg.dec +++ b/OvmfPkg/OvmfPkg.dec @@ -26,6 +26,9 @@ ## @libraryclass Verify blobs read from the VMM BlobVerifierLib|Include/Library/BlobVerifierLib.h =20 + ## @libraryclass Measure blobs read from the VMM + BlobMeasurementLib|Include/Library/BlobMeasurementLib.h + ## @libraryclass Loads and boots a Linux kernel image # LoadLinuxLib|Include/Library/LoadLinuxLib.h --=20 2.29.2.windows.2 -=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 (#89955): https://edk2.groups.io/g/devel/message/89955 Mute This Topic: https://groups.io/mt/91282947/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-