From nobody Wed May 15 05:43:52 2024 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+110182+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+110182+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1698385400; cv=none; d=zohomail.com; s=zohoarc; b=nh3OBpo0PiN3M5qrHRBN7TK+pkkbPanlrkswSZMb/w2bZtceF9UcvM0BEq3ovhhl3fZPdDlvwnqH8Tz3nMFOyZp/FoB9L7kf+ZqEtmjFLz0io2MSNV1zsXpgOg0Bxj9MPvGuy6Ht5DMYLPbVQJVEUBOIhaLvso534cwNQsMPhAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698385400; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=3pd46yjX0Mv2koAGoGdryAkzKk92X9HTG/Z8zQZ+I6w=; b=n1TDu8hDcIA4hrLtzE5wcjhHHn9WJQYiMhlGq5wlaLlC9UBXIdOMVSZ+LwNEwkLsPwLBaSv6ksAb/w8sbRqYPAMvITK8Y3NeFNe+dlGoEtc6BJh9YwopgbBKqv3VMeIPK6XVDZFcequAwEWdm542AWUkqeMGW7btVz2Ot1go88k= 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+110182+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 1698385400025225.9647172768232; Thu, 26 Oct 2023 22:43:20 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=schq1VkmWlgWrnTkmGFrT41KYtUcD36OnqSXAy4XHB8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698385399; v=1; b=dWlV6lsLdQyrFCT9pGAOIy4Kqy/IQ5iBUV5fKUpHI2RirGbmIHbTLn376OLjSTbmH1JgQFqw cCnSlqkv1RxdvV/AMVSXb8VrMQ+xsLfReDpewJ/qpHn+sDfgJWVfRh6eEHC09FfVsSfX8alfDpx lhkwLEhBiWxKY2JZV7CQ3oo0= X-Received: by 127.0.0.2 with SMTP id uFUkYY1788612xgGdddGQjqr; Thu, 26 Oct 2023 22:43:19 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.894.1698385395579600088 for ; Thu, 26 Oct 2023 22:43:19 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="391587812" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="391587812" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="763089386" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="763089386" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.43]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:17 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Ray Ni Subject: [edk2-devel] [PATCH 1/7] MdePkg: Create TdxLibNull.inf instance Date: Fri, 27 Oct 2023 13:42:54 +0800 Message-Id: <20231027054300.1382-2-dun.tan@intel.com> In-Reply-To: <20231027054300.1382-1-dun.tan@intel.com> References: <20231027054300.1382-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk 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,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: HrjpP4J4pJq4ah9Vj1SQdK6ex1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698385400793100001 Content-Type: text/plain; charset="utf-8" Create null instance for TdxLib. The IoLib instance BaseIoLibIntrinsic.inf will consume the TdxLibNull to pass build. Signed-off-by: Dun Tan Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Ray Ni --- MdePkg/Library/TdxLib/TdxLibNull.inf | 21 +++++++++++++++++++++ MdePkg/MdePkg.dsc | 1 + 2 files changed, 22 insertions(+) diff --git a/MdePkg/Library/TdxLib/TdxLibNull.inf b/MdePkg/Library/TdxLib/T= dxLibNull.inf new file mode 100644 index 0000000000..ecf20e12e1 --- /dev/null +++ b/MdePkg/Library/TdxLib/TdxLibNull.inf @@ -0,0 +1,21 @@ +## @file +# Tdx null instance. +# +# Copyright (c) 2023, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D TdxLibNull + FILE_GUID =3D AA75759C-24E0-42FE-B5A4-83678548FCEF + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D TdxLib + +[Sources] + TdxLibNull.c + +[Packages] + MdePkg/MdePkg.dec diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index 3abd1a1e23..a1be123d80 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -184,6 +184,7 @@ MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf MdePkg/Library/TdxLib/TdxLib.inf + MdePkg/Library/TdxLib/TdxLibNull.inf MdePkg/Library/MipiSysTLib/MipiSysTLib.inf MdePkg/Library/TraceHubDebugSysTLibNull/TraceHubDebugSysTLibNull.inf =20 --=20 2.31.1.windows.1 -=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 (#110182): https://edk2.groups.io/g/devel/message/110182 Mute This Topic: https://groups.io/mt/102215662/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- From nobody Wed May 15 05:43:52 2024 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+110183+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+110183+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1698385403; cv=none; d=zohomail.com; s=zohoarc; b=QuNXkdwTQ/kaMHgrvXFomqV4TEoqxV6nE5/ad3hK7ELfRG3Nj5EqWJwbcHvubvUr5ERXhnWFJ71UqOeGIlFPaN/2WeO1tK/woC8Q+CUxbj6sj+8OsHYWXoPcF6CWrU9OOMlQW9/ld1TTJ3aM/rChBlzE5JFGP8F4sHzQrO4g3AI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698385403; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=ewYRKXLHm9u1QNKPB/V+0qYR2iylH0dzt5IHaqKL+rE=; b=T9CywgkXjPBrGGIiODEkevwQBPlIewIlPk+U3pLsquCBX7978tkmUlnkzYyMsGjPjVSM2xdocOG8pDKTHTxWrn+6hY8bhPE/DHgp8CnPSPg4mGHdNVUFSKwmwT5Ed5JhEd6yDmky+IYA7hSXDeKDc1aNQ61sYpHwpVb8D4n86U8= 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+110183+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 1698385403857977.3898574619076; Thu, 26 Oct 2023 22:43:23 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=OFu/sYTtdcE9BP56xgFO7LwAV0nyq3OIGuKQLAoB/2A=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698385403; v=1; b=Rhlw17cBcgia2TRmaQEvzrvnnSQUWdQLJUrQmyETEBrjoeEilZr2lOlUueLA2tjHs8B1eMtq faTKpji9plpoHcsqUcLfRgguZ3XLGVZ0UfktMrNZsIQSKJ/U8onIk4ALFZT7rwEj/mhEBKDFjsB kJXphX/F/RCKfEscUBusctlw= X-Received: by 127.0.0.2 with SMTP id OxURYY1788612xI1gergikad; Thu, 26 Oct 2023 22:43:23 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.894.1698385395579600088 for ; Thu, 26 Oct 2023 22:43:23 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="391587818" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="391587818" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="763089395" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="763089395" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.43]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:21 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Ray Ni Subject: [edk2-devel] [PATCH 2/7] MdePkg: Add CcProbeLibNull and TdxLibNull implement Date: Fri, 27 Oct 2023 13:42:55 +0800 Message-Id: <20231027054300.1382-3-dun.tan@intel.com> In-Reply-To: <20231027054300.1382-1-dun.tan@intel.com> References: <20231027054300.1382-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk 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,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: e820eMpVQ6lGmb33d4vexCiQx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698385404851100007 Content-Type: text/plain; charset="utf-8" Add CcProbeLibNull and TdxLibNull implement in the MdeLibs.dsc.inc. The IoLib instance BaseIoLibIntrinsic will consume the two lib instance in the following patch. Add the two null instance in this file to avoid build failure. Signed-off-by: Dun Tan Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Ray Ni --- MdePkg/MdeLibs.dsc.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MdePkg/MdeLibs.dsc.inc b/MdePkg/MdeLibs.dsc.inc index 4580481cb5..0525283cfd 100644 --- a/MdePkg/MdeLibs.dsc.inc +++ b/MdePkg/MdeLibs.dsc.inc @@ -5,7 +5,7 @@ # by using "!include MdePkg/MdeLibs.dsc.inc" to specify the library instan= ces # of some EDKII basic/common library classes. # -# Copyright (c) 2021 - 2022, Intel Corporation. All rights reserved.
+# Copyright (c) 2021 - 2023, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -16,3 +16,5 @@ RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLib= Null.inf CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf SmmCpuRendezvousLib|MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezv= ousLibNull.inf + CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf + TdxLib|MdePkg/Library/TdxLib/TdxLibNull.inf --=20 2.31.1.windows.1 -=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 (#110183): https://edk2.groups.io/g/devel/message/110183 Mute This Topic: https://groups.io/mt/102215663/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- From nobody Wed May 15 05:43:52 2024 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+110184+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+110184+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1698385406; cv=none; d=zohomail.com; s=zohoarc; b=G1oDDNpe8W2htpw4c3gYeev5HCuO4KQkcUNOQ19fQm2F0uwzTS7qbi7+4xyIeGcB013yNjbtvjktb19CSETxweIt558ZswCotYkOtBMQXeiyf4oGKLMWkSGhH5hobg86o+dfM0iLPpI3zwLPXxncJGXFoDd2SdwpwgBDG4u4/wM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698385406; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=EtNoe2cNnK6aMjSyPxrtfikQ/JNvLmzI3EMEkesWD/Q=; b=hgnDKKPgTvr7efXPjrSzupQBPV56n+c2i/VHHOPDIsrcpByGwO9UHXRWrclE14klrHiZK+HWXvNZ1obTpjsNNkMBrZ+luZPbFsJV7VmW7et5ufqnWFGVP2BUC6LzJXbI+heoSU+jq1oKk088pYaGy9xwLUnJChUB3jxsmY5g1GU= 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+110184+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 1698385406456146.7147456725238; Thu, 26 Oct 2023 22:43:26 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=QRzw4bt24rBS3RieCaC2MxtvD0Nq0omwSXAXSvyK8A8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698385406; v=1; b=F95BGEBY0XqU4Rp9/Y22jdR+xXCA+rp3bODhmiScsd/7vXhYZXYW62i44HAKDCehe/9Ct4sL CBvEP9Nu3M3a9e/PDUDkQuej5ctWq+dWMtZ6Lv9i8J/FpcuqOgT7iZMuqtqyXab8ijyyWcgdHwS e6KiZNbnd0oofnL1UItrGk14= X-Received: by 127.0.0.2 with SMTP id yFSFYY1788612xSlcxlJpkDj; Thu, 26 Oct 2023 22:43:26 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.894.1698385395579600088 for ; Thu, 26 Oct 2023 22:43:25 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="391587827" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="391587827" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="763089408" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="763089408" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.43]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:23 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Ray Ni Subject: [edk2-devel] [PATCH 3/7] MdePkg: simplify IoRead/WriteFifo in IoLibFifo.c Date: Fri, 27 Oct 2023 13:42:56 +0800 Message-Id: <20231027054300.1382-4-dun.tan@intel.com> In-Reply-To: <20231027054300.1382-1-dun.tan@intel.com> References: <20231027054300.1382-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk 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,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: I9GTGHklezXwQ0hDZWfC2dSlx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698385407030100001 Content-Type: text/plain; charset="utf-8" Simplify IoRead/WriteFifo implement in IoLibFifo.c by repeatedly calling IoRead/Write API in C code. This can avoid calling assembly code to use string I/O instructions and avoid checking if sev feature is enabled. Then the code flow is simplified. Signed-off-by: Dun Tan Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Ray Ni --- MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c | 44 +++++++++++++++++++++++= ++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c b/MdePkg/Library= /BaseIoLibIntrinsic/IoLibFifo.c index 9a94bc6a05..adce1040f6 100644 --- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c +++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c @@ -1,7 +1,7 @@ /** @file IoFifo read/write routines. =20 - Copyright (c) 2021, Intel Corporation. All rights reserved.
+ Copyright (c) 2021-2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -39,10 +39,15 @@ IoReadFifo8 ( OUT VOID *Buffer ) { + UINT8 *Buffer8; + if (IsTdxGuest ()) { TdIoReadFifo8 (Port, Count, Buffer); } else { - SevIoReadFifo8 (Port, Count, Buffer); + Buffer8 =3D (UINT8 *)Buffer; + while (Count-- > 0) { + *Buffer8++ =3D IoRead8 (Port); + } } } =20 @@ -73,10 +78,15 @@ IoWriteFifo8 ( IN VOID *Buffer ) { + UINT8 *Buffer8; + if (IsTdxGuest ()) { TdIoWriteFifo8 (Port, Count, Buffer); } else { - SevIoWriteFifo8 (Port, Count, Buffer); + Buffer8 =3D (UINT8 *)Buffer; + while (Count-- > 0) { + IoWrite8 (Port, *Buffer8++); + } } } =20 @@ -107,10 +117,15 @@ IoReadFifo16 ( OUT VOID *Buffer ) { + UINT16 *Buffer16; + if (IsTdxGuest ()) { TdIoReadFifo16 (Port, Count, Buffer); } else { - SevIoReadFifo16 (Port, Count, Buffer); + Buffer16 =3D (UINT16 *)Buffer; + while (Count-- > 0) { + *Buffer16++ =3D IoRead16 (Port); + } } } =20 @@ -141,10 +156,15 @@ IoWriteFifo16 ( IN VOID *Buffer ) { + UINT16 *Buffer16; + if (IsTdxGuest ()) { TdIoWriteFifo16 (Port, Count, Buffer); } else { - SevIoWriteFifo16 (Port, Count, Buffer); + Buffer16 =3D (UINT16 *)Buffer; + while (Count-- > 0) { + IoWrite16 (Port, *Buffer16++); + } } } =20 @@ -175,10 +195,15 @@ IoReadFifo32 ( OUT VOID *Buffer ) { + UINT32 *Buffer32; + if (IsTdxGuest ()) { TdIoReadFifo32 (Port, Count, Buffer); } else { - SevIoReadFifo32 (Port, Count, Buffer); + Buffer32 =3D (UINT32 *)Buffer; + while (Count-- > 0) { + *Buffer32++ =3D IoRead32 (Port); + } } } =20 @@ -209,9 +234,14 @@ IoWriteFifo32 ( IN VOID *Buffer ) { + UINT32 *Buffer32; + if (IsTdxGuest ()) { TdIoWriteFifo32 (Port, Count, Buffer); } else { - SevIoWriteFifo32 (Port, Count, Buffer); + Buffer32 =3D (UINT32 *)Buffer; + while (Count-- > 0) { + IoWrite32 (Port, *Buffer32++); + } } } --=20 2.31.1.windows.1 -=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 (#110184): https://edk2.groups.io/g/devel/message/110184 Mute This Topic: https://groups.io/mt/102215664/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- From nobody Wed May 15 05:43:52 2024 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+110185+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+110185+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1698385409; cv=none; d=zohomail.com; s=zohoarc; b=jM1ze/sVcvlt1sTO4Iv/xWGZpwJ8aOIXywSkGZK8BHcqZiu4somSdBQN5x6Q83ZKDMlE+iwa0zFd1Rs2nRunpqWYrqsCNqmiR5HrnGC9NjkjAYL8cj18dxucdP67DVXqzUTV+vepSf7HGPJmZroQyK2AL+jI1LX2/bxyRpihLVs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698385409; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=G3PmDAwCShUd2vQJizFp583NFi/BRC1J3l4f3pWFGEg=; b=ILG0ZT8yYFPFOUSmz9pX5trVWHeu12wPwXo1H43IasE6K1jeBC+GFaaR+Jf+TbHPIli4b5FkuKJuh0A0j0DgEvbJmYl79zbbZyHYqAI/u1l1GZTYpF/VNU9SjVbwRBorSIWETjYRhPzOBJ97HLldydPYW3asp9gI7I4o6h2bhmA= 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+110185+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 1698385409147726.7038539743561; Thu, 26 Oct 2023 22:43:29 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Wp9aS/8czkfB8i9pWaJZXRwEOa63xZ4C5XiFQWX6Tt0=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698385408; v=1; b=rAgXt/rrUuDj7+soHnN7EUq0M3phVqa5GT07ZEVhEMAbzRmICzVtggxUjknRJL1UmYoG/kfm 3yMTAmFVIt2hkdAW7P0c/4isaVaQ+K6nP0Q8aSVs3708H5ArxImrWWI4rj6Cafv9ib4EBik2CAh upnlYpk42tsK/J/F/WlL0UcI= X-Received: by 127.0.0.2 with SMTP id 7GJoYY1788612xuBIAVzCRZM; Thu, 26 Oct 2023 22:43:28 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.894.1698385395579600088 for ; Thu, 26 Oct 2023 22:43:28 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="391587834" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="391587834" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="763089432" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="763089432" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.43]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:26 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Ray Ni Subject: [edk2-devel] [PATCH 4/7] MdePkg:support Tdx and sev in BaseIoLibIntrinsic Date: Fri, 27 Oct 2023 13:42:57 +0800 Message-Id: <20231027054300.1382-5-dun.tan@intel.com> In-Reply-To: <20231027054300.1382-1-dun.tan@intel.com> References: <20231027054300.1382-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk 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,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: rOjBRplwRbVgp3Fhl621cvAmx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698385410964100007 Content-Type: text/plain; charset="utf-8" Change IA32 and X64 arch source files for BaseIoLibIntrinsic to support Tdx and sev. Use IoFifoRead/Write API in IoLibFifo.c and the IoLibInternalTdx.c instead of IoFifoSev.nasm for BaseIoLibIntrinsic. With this change, BaseIoLibIntrinsic can also support Tdx guest and sev. Then the assembly code and instance for BaseIoLibIntrinsicSev can be removed. Signed-off-by: Dun Tan Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Ray Ni --- MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf | 14 ++++++++++--= -- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf b/Mde= Pkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf index aeb072ee95..e1a2e1eed8 100644 --- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf +++ b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf @@ -7,7 +7,7 @@ # ASSERT(). For ARM, AARCH64, RISCV64 and LoongArch, this I/O library onl= y provides # non I/O read and write. # -# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2023, Intel Corporation. All rights reserved.
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
# Copyright (c) 2017, AMD Incorporated. All rights reserved.
# Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP.= All rights reserved.
@@ -35,24 +35,26 @@ IoLibMmioBuffer.c BaseIoLibIntrinsicInternal.h IoHighLevel.c - IoLibInternalTdxNull.c IoLibTdx.h =20 [Sources.IA32] IoLibGcc.c | GCC IoLibMsc.c | MSFT IoLib.c - Ia32/IoFifo.nasm + IoLibFifo.c + IoLibInternalTdxNull.c =20 [Sources.X64] IoLibGcc.c | GCC IoLibMsc.c | MSFT IoLib.c - X64/IoFifo.nasm + IoLibFifo.c + IoLibInternalTdx.c =20 [Sources.EBC] IoLibEbc.c IoLib.c + IoLibInternalTdxNull.c =20 [Sources.ARM] IoLibNoIo.c @@ -74,3 +76,7 @@ BaseLib RegisterFilterLib =20 +[LibraryClasses.X64] + TdxLib + CcProbeLib + --=20 2.31.1.windows.1 -=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 (#110185): https://edk2.groups.io/g/devel/message/110185 Mute This Topic: https://groups.io/mt/102215665/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- From nobody Wed May 15 05:43:52 2024 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+110186+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+110186+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1698385422; cv=none; d=zohomail.com; s=zohoarc; b=SdwMjI884wgTCRn5d5M7JYRt/ko0LTMSAhnpwQhV3aRK45JwxVtYSb3HwtGFUNzYdmOCCDCfhy8qspnNWV6lmVFy92+H1QoL/D8f3hqBAQvgEPpUe/lvmbbrHYqVjGckjJv471oWTG12w+z9O4jrOOBBS3GdEeesBS5wOEIhwwI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698385422; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=6VF4wxP5rTAFqRrS254prt3rR4nVj5SzYZwCY7z7/PA=; b=YtFuJOt5FPxHw7n07hQnLFm0xmOdkJ0gAkZ/kPUcuNWHqobFttPUqAN7Z2XEzlffoLXqEcNZB1jZ2gbbP+BkAwYYvu/p3kBunLDgGXrvsgeP20QvjKwUl/X7Z3uNJGbOoLKjdXvFjsDLhoESMJF58DT428fkUSIpqClBc3OTYPk= 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+110186+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 1698385422236800.1340555967741; Thu, 26 Oct 2023 22:43:42 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=rwGg0agSWQ/jJh0kRl3m9cAJuUvfcxKaV3ewTQhkpC0=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698385421; v=1; b=TDd0Pu0QtjcPdW51q0anit+6OSumS7QidV4DM1t77SQaVyncnqcZXO9rY2ezkLMz/WQDIvj3 qwIdCp0gHh11Y2oQgezvdzKsxFydfKIenAzivgetgiyWEBlTr6oc4xpbCVjFmCxfVtixJGl6MZU 6VTNf0R3VCW5MgbrD/I9/D5Q= X-Received: by 127.0.0.2 with SMTP id EoS4YY1788612xmxZr9hmnr7; Thu, 26 Oct 2023 22:43:41 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.931.1698385420739806443 for ; Thu, 26 Oct 2023 22:43:41 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="391587859" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="391587859" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="763089496" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="763089496" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.43]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:38 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Ray Ni Subject: [edk2-devel] [PATCH 5/7] OvmfPkg: Add CcProbeLib in PlatformInitLib.inf Date: Fri, 27 Oct 2023 13:42:58 +0800 Message-Id: <20231027054300.1382-6-dun.tan@intel.com> In-Reply-To: <20231027054300.1382-1-dun.tan@intel.com> References: <20231027054300.1382-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk 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,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 7jTn7ws6NG0806euk3mVOXaix1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698385423220100003 Content-Type: text/plain; charset="utf-8" PlatformInitLib uses the CcProbe API in MemDetect.c but doensn't add CcProbeLib in .inf LibraryClasses section. Add CcProbeLib to fix the build error. Signed-off-by: Dun Tan Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Ray Ni Reviewed-by: Ard Biesheuvel --- OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf b/OvmfPkg/= Library/PlatformInitLib/PlatformInitLib.inf index 5a79d95b68..8ff9e699b1 100644 --- a/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf +++ b/OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf @@ -2,7 +2,7 @@ # Platform Initialization Lib # # This module provides platform specific function to detect boot mode. -# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2023, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -52,6 +52,7 @@ PcdLib PciLib PeiHardwareInfoLib + CcProbeLib =20 [LibraryClasses.X64] TdxLib --=20 2.31.1.windows.1 -=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 (#110186): https://edk2.groups.io/g/devel/message/110186 Mute This Topic: https://groups.io/mt/102215667/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- From nobody Wed May 15 05:43:52 2024 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+110187+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+110187+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1698385424; cv=none; d=zohomail.com; s=zohoarc; b=BoCKpMT/PAwLjQGX/9PtmLro2bdZsAMRxfX5Ht0KMIRY1ukZLgVmuXZpFQ273JBQ41z63gaSty0FRh5AdyY5AKE+/Fcnif7CQCuw7Zg6+j1PA5DqyBQSpCtoTMkxieVmfZRmlNlHcXg0x4A755myQYpxrpM+mBMvYHeIAZV40u0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698385424; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=Ez6o2Sd5rMRbm4xYf5pTAS3A7CN7xm6DI34VVaMuCpM=; b=ZYIB6w+wnb7nNJEo+0bwlO9hDG/VruPpAdSryA/PGLDOGtlEgbRy3/TVpyWDSQwhILlDR9I/GzZZ2TSN8cJE4v7b7Hri6H7gqmTfhJfoxJ9n4tLr9Hvzw4pvz0Wcw9bgeyCwAP/U/0Bgme5YYL6tpnhWN0qu6h2F3QcYk2nLmeY= 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+110187+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 1698385424137269.56586853300814; Thu, 26 Oct 2023 22:43:44 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=uJTvBYD4OPs1FoY3nAal6zgaGyDqNYp9DOrNKx4aMk0=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698385423; v=1; b=Mp7pNrOWPclq8Q7XqTwtz2y+SVavGVb7eMum88fGAd4lCnr7N/y5POFOdKQ6deKDzBvDrnt3 SUyltpN+KfhYJfrEJQshq+9Rm49pud9KBrsp/jIeY90IX+M3hH0cIoId/RUKNqjIbBlBnr+UlgT NjAzmGYhpzvrZ1SETJ70C1so= X-Received: by 127.0.0.2 with SMTP id 5kMWYY1788612xvpo32GNDEJ; Thu, 26 Oct 2023 22:43:43 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.931.1698385420739806443 for ; Thu, 26 Oct 2023 22:43:43 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="391587865" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="391587865" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="763089502" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="763089502" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.43]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:41 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Ray Ni Subject: [edk2-devel] [PATCH 6/7] OvmfPkg: use BaseIoLibIntrinsic.inf in dsc files Date: Fri, 27 Oct 2023 13:42:59 +0800 Message-Id: <20231027054300.1382-7-dun.tan@intel.com> In-Reply-To: <20231027054300.1382-1-dun.tan@intel.com> References: <20231027054300.1382-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk 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,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 3zGTmPsXkTDzxzQUwZuRYR58x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698385425366100007 Content-Type: text/plain; charset="utf-8" Use BaseIoLibIntrinsic.inf in dsc files. The BaseIoLibIntrinsic supports Tdx and sev now. The BaseIoLibIntrinsicSev will be removed in the following patches. Signed-off-by: Dun Tan Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Ray Ni Reviewed-by: Ard Biesheuvel --- OvmfPkg/AmdSev/AmdSevX64.dsc | 2 +- OvmfPkg/Bhyve/BhyveX64.dsc | 2 +- OvmfPkg/CloudHv/CloudHvX64.dsc | 2 +- OvmfPkg/IntelTdx/IntelTdxX64.dsc | 2 +- OvmfPkg/Microvm/MicrovmX64.dsc | 2 +- OvmfPkg/OvmfPkgIa32.dsc | 2 +- OvmfPkg/OvmfPkgIa32X64.dsc | 2 +- OvmfPkg/OvmfPkgX64.dsc | 2 +- OvmfPkg/OvmfXen.dsc | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index 302c90e7c2..06086e0cc5 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -142,7 +142,7 @@ PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPc= iSegmentLib.inf PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index 6693342c5f..1376dd7468 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -149,7 +149,7 @@ PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPc= iSegmentLib.inf PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc index 35942e02df..1d2a13dd92 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.dsc +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc @@ -159,7 +159,7 @@ PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPc= iSegmentLib.inf PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX6= 4.dsc index 182ec3705d..6623196c8b 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -146,7 +146,7 @@ PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPc= iSegmentLib.inf PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf CcProbeLib|OvmfPkg/Library/CcProbeLib/DxeCcProbeLib.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index 0f26f2a9a9..c76a135f9e 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -157,7 +157,7 @@ PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPc= iSegmentLib.inf PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index fcd3a3fda5..a850465e77 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -162,7 +162,7 @@ PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPc= iSegmentLib.inf PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index d0ae0b996d..9c6615b487 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -167,7 +167,7 @@ PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPc= iSegmentLib.inf PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index a6811eee55..9e054aa489 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -179,7 +179,7 @@ PciCapLib|OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPc= iSegmentLib.inf PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index ccd3a873c7..ab4bdb2628 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -150,7 +150,7 @@ PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPc= iSegmentLib.inf PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf --=20 2.31.1.windows.1 -=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 (#110187): https://edk2.groups.io/g/devel/message/110187 Mute This Topic: https://groups.io/mt/102215668/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- From nobody Wed May 15 05:43:52 2024 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+110188+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+110188+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1698385428; cv=none; d=zohomail.com; s=zohoarc; b=mnj0+bp0RkhshFXNkN8DQaMxRYSASYNusZl722soyPT+cFYR5lVdk1LFrTsNXAf0TYmeA5/hYZrByQchT+TDq6LapNgE1ez9VBaCxVzYk4RXJBwF6kd7oy1vrKe8pfcOnXVnZb0FBzpNvibWE+ngjh90VGifcr6VheTRg7Mnq6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698385428; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=QT0WCIpzJUXl+TUBX2rM162MG/y+SzwjJajC98XMepA=; b=ee0K7X+NMrzRbNWPjPi6JzISiu/dq/6/p5rpuwNabRLXBnX8d7qPWjyMy7e9oxFCGnysRACwYeobdQc4MRdIM33dAKbdj4Qlyj89Wn6MiuZ2fs5DYM0bWt64084wBNdMfv+jptfqRAj41jmi2S4p/RC6gDFVNWH9j07KbvDQoNI= 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+110188+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 1698385428164640.6289414374396; Thu, 26 Oct 2023 22:43:48 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=jjvO4GMKy1tjRH3myz2Riv1QHuoZRqrLgJ/W8LBnLMM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698385426; v=1; b=bw1C01mr7qe9epIp5LopIicg41IhTpjsMmvwFdhbUZEbWKy/NPwL6Z4ddDIRLG4+yGygAwOF YJiVDd+Wv+e6yzqsz++WHBTC+Sxgz7NLwlYsLNknlKRuaNb5Mj2/oiV5qXYZW1uHEZTaOxWeWrQ 6SJWcRx9Gg289HK2yqEsSiiA= X-Received: by 127.0.0.2 with SMTP id n9GnYY1788612xsaZfrhkXwr; Thu, 26 Oct 2023 22:43:46 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.931.1698385420739806443 for ; Thu, 26 Oct 2023 22:43:46 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="391587870" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="391587870" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="763089509" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="763089509" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.43]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 22:43:44 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Ray Ni Subject: [edk2-devel] [PATCH 7/7] MdePkg:remove BaseIoLibIntrinsicSev related code Date: Fri, 27 Oct 2023 13:43:00 +0800 Message-Id: <20231027054300.1382-8-dun.tan@intel.com> In-Reply-To: <20231027054300.1382-1-dun.tan@intel.com> References: <20231027054300.1382-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk 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,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: QltwVSv4tDCxWxvqgY0nDwc8x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1698385429504100003 Content-Type: text/plain; charset="utf-8" Remove BaseIoLibIntrinsicSev related code in MdePkg. Signed-off-by: Dun Tan Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Ray Ni --- MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf | 61 --------= ----------------------------------------------------- MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm | 131 --------= ---------------------------------------------------------------------------= ------------------------------------------------ MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifoSev.nasm | 293 --------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------------------------------------------------------------ MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c | 1 - MdePkg/Library/BaseIoLibIntrinsic/IoLibSev.h | 166 --------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= -------- MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm | 120 --------= ---------------------------------------------------------------------------= ------------------------------------- MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifoSev.nasm | 282 --------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------------------------------------------------- MdePkg/MdePkg.dsc | 1 - 8 files changed, 1055 deletions(-) diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf b/= MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf deleted file mode 100644 index e1b8298ac4..0000000000 --- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf +++ /dev/null @@ -1,61 +0,0 @@ -## @file -# Instance of I/O Library using compiler intrinsics. -# -# I/O Library that uses compiler intrinsics to perform IN and OUT instruc= tions -# for IA-32 and x64. -# -# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Copyright (c) 2017, AMD Incorporated. All rights reserved.
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D BaseIoLibIntrinsicSev - MODULE_UNI_FILE =3D BaseIoLibIntrinsic.uni - FILE_GUID =3D 93742f95-6e71-4581-b600-8e1da443f95a - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D IoLib - - -# -# VALID_ARCHITECTURES =3D IA32 X64 -# - -[Sources] - IoLibMmioBuffer.c - BaseIoLibIntrinsicInternal.h - IoHighLevel.c - IoLibTdx.h - IoLibSev.h - -[Sources.IA32] - IoLibGcc.c | GCC - IoLibMsc.c | MSFT - IoLib.c - IoLibInternalTdxNull.c - Ia32/IoFifoSev.nasm - -[Sources.X64] - IoLibGcc.c | GCC - IoLibMsc.c | MSFT - IoLib.c - IoLibInternalTdx.c - IoLibFifo.c - X64/IoFifoSev.nasm - -[Packages] - MdePkg/MdePkg.dec - -[LibraryClasses] - DebugLib - BaseLib - RegisterFilterLib - CcProbeLib - -[LibraryClasses.X64] - TdxLib diff --git a/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm b/MdePkg/Li= brary/BaseIoLibIntrinsic/Ia32/IoFifo.nasm deleted file mode 100644 index a4ae1a0053..0000000000 --- a/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm +++ /dev/null @@ -1,131 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights reserved.
-; -; SPDX-License-Identifier: BSD-2-Clause-Patent -; -;-------------------------------------------------------------------------= ----- - - SECTION .text - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo8 ( -; IN UINTN Port, -; IN UINTN Size, -; OUT VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo8) -ASM_PFX(IoReadFifo8): - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insb - pop edi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo16 ( -; IN UINTN Port, -; IN UINTN Size, -; OUT VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo16) -ASM_PFX(IoReadFifo16): - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insw - pop edi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo32 ( -; IN UINTN Port, -; IN UINTN Size, -; OUT VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo32) -ASM_PFX(IoReadFifo32): - push edi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] -rep insd - pop edi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo8 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo8) -ASM_PFX(IoWriteFifo8): - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsb - pop esi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo16 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo16) -ASM_PFX(IoWriteFifo16): - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsw - pop esi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo32 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo32) -ASM_PFX(IoWriteFifo32): - push esi - cld - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] -rep outsd - pop esi - ret - diff --git a/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifoSev.nasm b/MdePkg= /Library/BaseIoLibIntrinsic/Ia32/IoFifoSev.nasm deleted file mode 100644 index 63a4771d3c..0000000000 --- a/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifoSev.nasm +++ /dev/null @@ -1,293 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights reserved.
-; -; SPDX-License-Identifier: BSD-2-Clause-Patent -; -;-------------------------------------------------------------------------= ----- - - SECTION .text - -;-------------------------------------------------------------------------= ----- -; Check whether we need to unroll the String I/O under SEV guest -; -; Return // eax (1 - unroll, 0 - no unroll) -;-------------------------------------------------------------------------= ----- -global ASM_PFX(SevNoRepIo) -ASM_PFX(SevNoRepIo): - - ; CPUID clobbers ebx, ecx and edx - push ebx - push ecx - push edx - - ; Check if we are running under hypervisor - ; CPUID(1).ECX Bit 31 - mov eax, 1 - cpuid - bt ecx, 31 - jnc @UseRepIo - - ; Check if we have Memory encryption CPUID leaf - mov eax, 0x80000000 - cpuid - cmp eax, 0x8000001f - jl @UseRepIo - - ; Check for memory encryption feature: - ; CPUID Fn8000_001F[EAX] - Bit 1 - ; - mov eax, 0x8000001f - cpuid - bt eax, 1 - jnc @UseRepIo - - ; Check if memory encryption is enabled - ; MSR_0xC0010131 - Bit 0 (SEV enabled) - ; MSR_0xC0010131 - Bit 1 (SEV-ES enabled) - mov ecx, 0xc0010131 - rdmsr - - ; Check for (SevEsEnabled =3D=3D 0 && SevEnabled =3D=3D 1) - and eax, 3 - cmp eax, 1 - je @SevNoRepIo_Done - -@UseRepIo: - xor eax, eax - -@SevNoRepIo_Done: - pop edx - pop ecx - pop ebx - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo8 ( -; IN UINTN Port, -; IN UINTN Size, -; OUT VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo8) -ASM_PFX(IoReadFifo8): - push edi - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoReadFifo8_NoRep - - cld - rep insb - jmp @IoReadFifo8_Done - -@IoReadFifo8_NoRep: - jecxz @IoReadFifo8_Done - -@IoReadFifo8_Loop: - in al, dx - mov byte [edi], al - inc edi - loop @IoReadFifo8_Loop - -@IoReadFifo8_Done: - pop edi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo16 ( -; IN UINTN Port, -; IN UINTN Size, -; OUT VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo16) -ASM_PFX(IoReadFifo16): - push edi - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoReadFifo16_NoRep - - cld - rep insw - jmp @IoReadFifo16_Done - -@IoReadFifo16_NoRep: - jecxz @IoReadFifo16_Done - -@IoReadFifo16_Loop: - in ax, dx - mov word [edi], ax - add edi, 2 - loop @IoReadFifo16_Loop - -@IoReadFifo16_Done: - pop edi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo32 ( -; IN UINTN Port, -; IN UINTN Size, -; OUT VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo32) -ASM_PFX(IoReadFifo32): - push edi - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov edi, [esp + 16] - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoReadFifo32_NoRep - - cld - rep insd - jmp @IoReadFifo32_Done - -@IoReadFifo32_NoRep: - jecxz @IoReadFifo32_Done - -@IoReadFifo32_Loop: - in eax, dx - mov dword [edi], eax - add edi, 4 - loop @IoReadFifo32_Loop - -@IoReadFifo32_Done: - pop edi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo8 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo8) -ASM_PFX(IoWriteFifo8): - push esi - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoWriteFifo8_NoRep - - cld - rep outsb - jmp @IoWriteFifo8_Done - -@IoWriteFifo8_NoRep: - jecxz @IoWriteFifo8_Done - -@IoWriteFifo8_Loop: - mov al, byte [esi] - out dx, al - inc esi - loop @IoWriteFifo8_Loop - -@IoWriteFifo8_Done: - pop esi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo16 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo16) -ASM_PFX(IoWriteFifo16): - push esi - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoWriteFifo16_NoRep - - cld - rep outsw - jmp @IoWriteFifo16_Done - -@IoWriteFifo16_NoRep: - jecxz @IoWriteFifo16_Done - -@IoWriteFifo16_Loop: - mov ax, word [esi] - out dx, ax - add esi, 2 - loop @IoWriteFifo16_Loop - -@IoWriteFifo16_Done: - pop esi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo32 ( -; IN UINTN Port, -; IN UINTN Size, -; IN VOID *Buffer -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo32) -ASM_PFX(IoWriteFifo32): - push esi - mov dx, [esp + 8] - mov ecx, [esp + 12] - mov esi, [esp + 16] - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoWriteFifo32_NoRep - - cld - rep outsd - jmp @IoWriteFifo32_Done - -@IoWriteFifo32_NoRep: - jecxz @IoWriteFifo32_Done - -@IoWriteFifo32_Loop: - mov eax, dword [esi] - out dx, eax - add esi, 4 - loop @IoWriteFifo32_Loop - -@IoWriteFifo32_Done: - pop esi - ret - diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c b/MdePkg/Library= /BaseIoLibIntrinsic/IoLibFifo.c index adce1040f6..91c0637c7d 100644 --- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c +++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibFifo.c @@ -7,7 +7,6 @@ **/ =20 #include "BaseIoLibIntrinsicInternal.h" -#include "IoLibSev.h" #include "IoLibTdx.h" #include #include diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibSev.h b/MdePkg/Library/= BaseIoLibIntrinsic/IoLibSev.h deleted file mode 100644 index 6d7cafcff2..0000000000 --- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibSev.h +++ /dev/null @@ -1,166 +0,0 @@ -/** @file - Header file for SEV IO library. - - Copyright (c) 2021, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#ifndef IOLIB_SEV_H_ -#define IOLIB_SEV_H_ - -#include - -#include -#include - -/** - Reads an 8-bit I/O port fifo into a block of memory. - - Reads the 8-bit I/O fifo port specified by Port. - The port is read Count times, and the read data is - stored in the provided Buffer. - - This function must guarantee that all I/O read and write operations are - serialized. - - If 8-bit I/O port operations are not supported, then ASSERT(). - - @param Port The I/O port to read. - @param Count The number of times to read I/O port. - @param Buffer The buffer to store the read data into. - -**/ -VOID -EFIAPI -SevIoReadFifo8 ( - IN UINTN Port, - IN UINTN Count, - OUT VOID *Buffer - ); - -/** - Writes a block of memory into an 8-bit I/O port fifo. - - Writes the 8-bit I/O fifo port specified by Port. - The port is written Count times, and the write data is - retrieved from the provided Buffer. - - This function must guarantee that all I/O write and write operations are - serialized. - - If 8-bit I/O port operations are not supported, then ASSERT(). - - @param Port The I/O port to write. - @param Count The number of times to write I/O port. - @param Buffer The buffer to retrieve the write data from. - -**/ -VOID -EFIAPI -SevIoWriteFifo8 ( - IN UINTN Port, - IN UINTN Count, - IN VOID *Buffer - ); - -/** - Reads an 8-bit I/O port fifo into a block of memory. - - Reads the 8-bit I/O fifo port specified by Port. - The port is read Count times, and the read data is - stored in the provided Buffer. - - This function must guarantee that all I/O read and write operations are - serialized. - - If 8-bit I/O port operations are not supported, then ASSERT(). - - @param Port The I/O port to read. - @param Count The number of times to read I/O port. - @param Buffer The buffer to store the read data into. - -**/ -VOID -EFIAPI -SevIoReadFifo16 ( - IN UINTN Port, - IN UINTN Count, - OUT VOID *Buffer - ); - -/** - Writes a block of memory into an 8-bit I/O port fifo. - - Writes the 8-bit I/O fifo port specified by Port. - The port is written Count times, and the write data is - retrieved from the provided Buffer. - - This function must guarantee that all I/O write and write operations are - serialized. - - If 8-bit I/O port operations are not supported, then ASSERT(). - - @param Port The I/O port to write. - @param Count The number of times to write I/O port. - @param Buffer The buffer to retrieve the write data from. - -**/ -VOID -EFIAPI -SevIoWriteFifo16 ( - IN UINTN Port, - IN UINTN Count, - IN VOID *Buffer - ); - -/** - Reads an 8-bit I/O port fifo into a block of memory. - - Reads the 8-bit I/O fifo port specified by Port. - The port is read Count times, and the read data is - stored in the provided Buffer. - - This function must guarantee that all I/O read and write operations are - serialized. - - If 8-bit I/O port operations are not supported, then ASSERT(). - - @param Port The I/O port to read. - @param Count The number of times to read I/O port. - @param Buffer The buffer to store the read data into. - -**/ -VOID -EFIAPI -SevIoReadFifo32 ( - IN UINTN Port, - IN UINTN Count, - OUT VOID *Buffer - ); - -/** - Writes a block of memory into an 8-bit I/O port fifo. - - Writes the 8-bit I/O fifo port specified by Port. - The port is written Count times, and the write data is - retrieved from the provided Buffer. - - This function must guarantee that all I/O write and write operations are - serialized. - - If 8-bit I/O port operations are not supported, then ASSERT(). - - @param Port The I/O port to write. - @param Count The number of times to write I/O port. - @param Buffer The buffer to retrieve the write data from. - -**/ -VOID -EFIAPI -SevIoWriteFifo32 ( - IN UINTN Port, - IN UINTN Count, - IN VOID *Buffer - ); - -#endif diff --git a/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm b/MdePkg/Lib= rary/BaseIoLibIntrinsic/X64/IoFifo.nasm deleted file mode 100644 index d459072f6e..0000000000 --- a/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm +++ /dev/null @@ -1,120 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights reserved.
-; -; SPDX-License-Identifier: BSD-2-Clause-Patent -; -;-------------------------------------------------------------------------= ----- - - DEFAULT REL - SECTION .text - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo8 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; OUT VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo8) -ASM_PFX(IoReadFifo8): - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insb - mov rdi, r8 ; restore rdi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo16 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; OUT VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo16) -ASM_PFX(IoReadFifo16): - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insw - mov rdi, r8 ; restore rdi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoReadFifo32 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; OUT VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoReadFifo32) -ASM_PFX(IoReadFifo32): - cld - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi -rep insd - mov rdi, r8 ; restore rdi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo8 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo8) -ASM_PFX(IoWriteFifo8): - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsb - mov rsi, r8 ; restore rsi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo16 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo16) -ASM_PFX(IoWriteFifo16): - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsw - mov rsi, r8 ; restore rsi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo32 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(IoWriteFifo32) -ASM_PFX(IoWriteFifo32): - cld - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi -rep outsd - mov rsi, r8 ; restore rsi - ret - diff --git a/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifoSev.nasm b/MdePkg/= Library/BaseIoLibIntrinsic/X64/IoFifoSev.nasm deleted file mode 100644 index d02286b4d5..0000000000 --- a/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifoSev.nasm +++ /dev/null @@ -1,282 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights reserved.
-; -; SPDX-License-Identifier: BSD-2-Clause-Patent -; -;-------------------------------------------------------------------------= ----- - - DEFAULT REL - SECTION .text - -;-------------------------------------------------------------------------= ----- -; Check whether we need to unroll the String I/O in SEV guest -; -; Return // eax (1 - unroll, 0 - no unroll) -;-------------------------------------------------------------------------= ----- -global ASM_PFX(SevNoRepIo) -ASM_PFX(SevNoRepIo): - - ; CPUID clobbers ebx, ecx and edx - push rbx - push rcx - push rdx - - ; Check if we are runing under hypervisor - ; CPUID(1).ECX Bit 31 - mov eax, 1 - cpuid - bt ecx, 31 - jnc @UseRepIo - - ; Check if we have Memory encryption CPUID leaf - mov eax, 0x80000000 - cpuid - cmp eax, 0x8000001f - jl @UseRepIo - - ; Check for memory encryption feature: - ; CPUID Fn8000_001F[EAX] - Bit 1 - ; - mov eax, 0x8000001f - cpuid - bt eax, 1 - jnc @UseRepIo - - ; Check if memory encryption is enabled - ; MSR_0xC0010131 - Bit 0 (SEV enabled) - ; MSR_0xC0010131 - Bit 1 (SEV-ES enabled) - mov ecx, 0xc0010131 - rdmsr - - ; Check for (SevEsEnabled =3D=3D 0 && SevEnabled =3D=3D 1) - and eax, 3 - cmp eax, 1 - je @SevNoRepIo_Done - -@UseRepIo: - xor eax, eax - -@SevNoRepIo_Done: - pop rdx - pop rcx - pop rbx - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; SevIoReadFifo8 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; OUT VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(SevIoReadFifo8) -ASM_PFX(SevIoReadFifo8): - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoReadFifo8_NoRep - - cld - rep insb - jmp @IoReadFifo8_Done - -@IoReadFifo8_NoRep: - jrcxz @IoReadFifo8_Done - -@IoReadFifo8_Loop: - in al, dx - mov byte [rdi], al - inc rdi - loop @IoReadFifo8_Loop - -@IoReadFifo8_Done: - mov rdi, r8 ; restore rdi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; SevIoReadFifo16 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; OUT VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(SevIoReadFifo16) -ASM_PFX(SevIoReadFifo16): - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoReadFifo16_NoRep - - cld - rep insw - jmp @IoReadFifo16_Done - -@IoReadFifo16_NoRep: - jrcxz @IoReadFifo16_Done - -@IoReadFifo16_Loop: - in ax, dx - mov word [rdi], ax - add rdi, 2 - loop @IoReadFifo16_Loop - -@IoReadFifo16_Done: - mov rdi, r8 ; restore rdi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; SevIoReadFifo32 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; OUT VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(SevIoReadFifo32) -ASM_PFX(SevIoReadFifo32): - xchg rcx, rdx - xchg rdi, r8 ; rdi: buffer address; r8: save rdi - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoReadFifo32_NoRep - - cld - rep insd - jmp @IoReadFifo32_Done - -@IoReadFifo32_NoRep: - jrcxz @IoReadFifo32_Done - -@IoReadFifo32_Loop: - in eax, dx - mov dword [rdi], eax - add rdi, 4 - loop @IoReadFifo32_Loop - -@IoReadFifo32_Done: - mov rdi, r8 ; restore rdi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; IoWriteFifo8 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(SevIoWriteFifo8) -ASM_PFX(SevIoWriteFifo8): - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoWriteFifo8_NoRep - - cld - rep outsb - jmp @IoWriteFifo8_Done - -@IoWriteFifo8_NoRep: - jrcxz @IoWriteFifo8_Done - -@IoWriteFifo8_Loop: - mov al, byte [rsi] - out dx, al - inc rsi - loop @IoWriteFifo8_Loop - -@IoWriteFifo8_Done: - mov rsi, r8 ; restore rsi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; SevIoWriteFifo16 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(SevIoWriteFifo16) -ASM_PFX(SevIoWriteFifo16): - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoWriteFifo16_NoRep - - cld - rep outsw - jmp @IoWriteFifo16_Done - -@IoWriteFifo16_NoRep: - jrcxz @IoWriteFifo16_Done - -@IoWriteFifo16_Loop: - mov ax, word [rsi] - out dx, ax - add rsi, 2 - loop @IoWriteFifo16_Loop - -@IoWriteFifo16_Done: - mov rsi, r8 ; restore rsi - ret - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; SevIoWriteFifo32 ( -; IN UINTN Port, // rcx -; IN UINTN Size, // rdx -; IN VOID *Buffer // r8 -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(SevIoWriteFifo32) -ASM_PFX(SevIoWriteFifo32): - xchg rcx, rdx - xchg rsi, r8 ; rsi: buffer address; r8: save rsi - - ; Check if we need to unroll String I/O - call ASM_PFX(SevNoRepIo) - test eax, eax - jnz @IoWriteFifo32_NoRep - - cld - rep outsd - jmp @IoWriteFifo32_Done - -@IoWriteFifo32_NoRep: - jrcxz @IoWriteFifo32_Done - -@IoWriteFifo32_Loop: - mov eax, dword [rsi] - out dx, eax - add rsi, 4 - loop @IoWriteFifo32_Loop - -@IoWriteFifo32_Done: - mov rsi, r8 ; restore rsi - ret - diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index a1be123d80..87c7045f63 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -158,7 +158,6 @@ =20 [Components.IA32, Components.X64] MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf - MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf --=20 2.31.1.windows.1 -=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 (#110188): https://edk2.groups.io/g/devel/message/110188 Mute This Topic: https://groups.io/mt/102215669/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-