public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Min Xu" <min.m.xu@intel.com>
To: devel@edk2.groups.io
Cc: Min M Xu <min.m.xu@intel.com>,
	Erdem Aktas <erdemaktas@google.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	James Bottomley <jejb@linux.ibm.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>
Subject: [PATCH V1 2/6] OvmfPkg/TdxMailboxLib: Add NULL instance of TdxMailboxLib
Date: Thu, 15 Dec 2022 16:44:36 +0800	[thread overview]
Message-ID: <20221215084440.481-3-min.m.xu@intel.com> (raw)
In-Reply-To: <20221215084440.481-1-min.m.xu@intel.com>

From: Min M Xu <min.m.xu@intel.com>

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4172

TdxMailboxLib is designed only for TDX guest which arch is X64. This
patch set the VALID_ARCHITECTURES of TdxMailboxLib as X64.

Because in the following patches TdxMailboxLib will be included in
PlatformInitLib. While PlatformInitLib is imported by some X64 platforms
(for example AmdSevX64.dsc). So we need a NULL instance of TdxMailboxLib
which VALID_ARCHITECTURES is X64 as well. Based on this consideration
we design TdxMailboxLibNull.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
---
 .../Library/TdxMailboxLib/TdxMailboxLib.inf   |  7 ++--
 .../TdxMailboxLib/TdxMailboxLibNull.inf       | 34 +++++++++++++++++++
 2 files changed, 36 insertions(+), 5 deletions(-)
 create mode 100644 OvmfPkg/Library/TdxMailboxLib/TdxMailboxLibNull.inf

diff --git a/OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf b/OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf
index 3cf3690a16c7..e504bda0dd90 100644
--- a/OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf
+++ b/OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf
@@ -1,6 +1,6 @@
 #/** @file
 #
-#  TBD
+#  TdxMailbox Library
 #
 #  Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
 #  Copyright (c) 2008, Apple Inc. All rights reserved.<BR>
@@ -19,12 +19,9 @@
   LIBRARY_CLASS                  = TdxMailboxLib
 
 #
-#  VALID_ARCHITECTURES           = X64 IA32
+#  VALID_ARCHITECTURES           = X64
 #
 
-[Sources.IA32]
-  TdxMailboxNull.c
-
 [Sources.X64]
   TdxMailbox.c
 
diff --git a/OvmfPkg/Library/TdxMailboxLib/TdxMailboxLibNull.inf b/OvmfPkg/Library/TdxMailboxLib/TdxMailboxLibNull.inf
new file mode 100644
index 000000000000..8380d9f4f6d8
--- /dev/null
+++ b/OvmfPkg/Library/TdxMailboxLib/TdxMailboxLibNull.inf
@@ -0,0 +1,34 @@
+#/** @file
+#
+#  Null instance of TdxMailboxLib
+#
+#  Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2008, Apple Inc. All rights reserved.<BR>
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+#
+#**/
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = TdxMailboxLibNull
+  FILE_GUID                      = 002a1265-a1a0-47cd-bc69-4342b147f57d
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = TdxMailboxLib
+
+#
+#  VALID_ARCHITECTURES           = IA32 X64
+#
+
+[Sources]
+  TdxMailboxNull.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  OvmfPkg/OvmfPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
-- 
2.29.2.windows.2


  parent reply	other threads:[~2022-12-15  8:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15  8:44 [PATCH V1 0/6] Enable Multi-core based lazy-accept for TDVF Min Xu
2022-12-15  8:44 ` [PATCH V1 1/6] OvmfPkg/TdxMailboxLib: Delete global variables Min Xu
2022-12-15  8:44 ` Min Xu [this message]
2022-12-15  8:44 ` [PATCH V1 3/6] OvmfPkg: Add TdxMailboxLibNull in some platform dsc Min Xu
2022-12-15  8:44 ` [PATCH V1 4/6] OvmfPkg/Sec: Move TDX APs related nasm code to IntelTdxAPs.nasm Min Xu
2022-12-15  8:44 ` [PATCH V1 5/6] OvmfPkg: Enable APs to accept memory for TDVF Min Xu
2022-12-15  8:44 ` [PATCH V1 6/6] OvmfPkg/PlatformInitLib: Implement multi-core " Min Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221215084440.481-3-min.m.xu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox