From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.2818.1667279643333273629 for ; Mon, 31 Oct 2022 22:14:09 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=dUpuPlc0; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667279649; x=1698815649; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7RbB+SCXyQasjZnQcn0Wtuh6QLwiiSyZu67iLfW/mJk=; b=dUpuPlc0MdMyr2L8+DynGT/RCzJ0tJxO3xkwM6tRoEpgP+vqLC0n4bP1 6GC639vSQxhZtna4zE4gVfjqq5OQOEXyEv1uQ8bjJFVgxjwAhEqGoHOu/ 42e+YLY1cGfgcWLyVvFpJC8t6/gsLM2FxvxwZl9gfp+xcTlHJD1Y/ZXv5 l7n3AM2YOx19hHtcdi+fsDWGSjHP7Ek+VyQaQ9HbvoiRbmC4crNXpkKHm eZyFD7yWT9HDk6LG/io9lfq4pNnLtBZk2fGtLpjcrn5toY05Vk4mhcyhh zv83cAjTZ98BeJbczgYgJTMxjMt1meD7QoptxJETV6lf4w4PKSM9iGazr w==; X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="310162669" X-IronPort-AV: E=Sophos;i="5.95,229,1661842800"; d="scan'208";a="310162669" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2022 22:14:09 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="878985473" X-IronPort-AV: E=Sophos;i="5.95,229,1661842800"; d="scan'208";a="878985473" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.119]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2022 22:14:07 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [PATCH V5 03/10] OvmfPkg: Use BZ3937_EFI_RESOURCE_MEMORY_UNACCEPTED defined in MdeModulePkg Date: Tue, 1 Nov 2022 13:13:42 +0800 Message-Id: <20221101051349.13-4-min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: <20221101051349.13-1-min.m.xu@intel.com> References: <20221101051349.13-1-min.m.xu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Min M Xu RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3937 BZ3937_EFI_RESOURCE_MEMORY_UNACCEPTED is defined in MdeModulePkg. The files which use the definition are updated as well. Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Acked-by: Gerd Hoffmann Signed-off-by: Min Xu --- OvmfPkg/Library/PeilessStartupLib/Hob.c | 5 ++--- OvmfPkg/Library/PlatformInitLib/IntelTdx.c | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/OvmfPkg/Library/PeilessStartupLib/Hob.c b/OvmfPkg/Library/PeilessStartupLib/Hob.c index 5fc84a809025..630ce445ebec 100644 --- a/OvmfPkg/Library/PeilessStartupLib/Hob.c +++ b/OvmfPkg/Library/PeilessStartupLib/Hob.c @@ -20,10 +20,9 @@ #include #include #include +#include #include "PeilessStartupInternal.h" -#define EFI_RESOURCE_MEMORY_UNACCEPTED 7 - /** * Construct the HobList in SEC phase. * @@ -92,7 +91,7 @@ ConstructFwHobList ( // while (!END_OF_HOB_LIST (Hob)) { if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) { - if (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_UNACCEPTED) { + if (Hob.ResourceDescriptor->ResourceType == BZ3937_EFI_RESOURCE_MEMORY_UNACCEPTED) { PhysicalEnd = Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->ResourceLength; ResourceLength = Hob.ResourceDescriptor->ResourceLength; diff --git a/OvmfPkg/Library/PlatformInitLib/IntelTdx.c b/OvmfPkg/Library/PlatformInitLib/IntelTdx.c index c6d7c8bb6e0e..797f880df035 100644 --- a/OvmfPkg/Library/PlatformInitLib/IntelTdx.c +++ b/OvmfPkg/Library/PlatformInitLib/IntelTdx.c @@ -20,11 +20,11 @@ #include #include #include +#include #include #include -#define ALIGNED_2MB_MASK 0x1fffff -#define EFI_RESOURCE_MEMORY_UNACCEPTED 7 +#define ALIGNED_2MB_MASK 0x1fffff /** This function will be called to accept pages. Only BSP accepts pages. @@ -211,7 +211,7 @@ ValidateHobList ( EFI_RESOURCE_MEMORY_MAPPED_IO_PORT, EFI_RESOURCE_MEMORY_RESERVED, EFI_RESOURCE_IO_RESERVED, - EFI_RESOURCE_MEMORY_UNACCEPTED + BZ3937_EFI_RESOURCE_MEMORY_UNACCEPTED }; if (VmmHobList == NULL) { @@ -387,7 +387,7 @@ ProcessHobList ( if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) { DEBUG ((DEBUG_INFO, "\nResourceType: 0x%x\n", Hob.ResourceDescriptor->ResourceType)); - if (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_UNACCEPTED) { + if (Hob.ResourceDescriptor->ResourceType == BZ3937_EFI_RESOURCE_MEMORY_UNACCEPTED) { DEBUG ((DEBUG_INFO, "ResourceAttribute: 0x%x\n", Hob.ResourceDescriptor->ResourceAttribute)); DEBUG ((DEBUG_INFO, "PhysicalStart: 0x%llx\n", Hob.ResourceDescriptor->PhysicalStart)); DEBUG ((DEBUG_INFO, "ResourceLength: 0x%llx\n", Hob.ResourceDescriptor->ResourceLength)); @@ -488,7 +488,7 @@ TransferTdxHobList ( ResourceType = Hob.ResourceDescriptor->ResourceType; ResourceAttribute = Hob.ResourceDescriptor->ResourceAttribute; - if (ResourceType == EFI_RESOURCE_MEMORY_UNACCEPTED) { + if (ResourceType == BZ3937_EFI_RESOURCE_MEMORY_UNACCEPTED) { ResourceType = EFI_RESOURCE_SYSTEM_MEMORY; ResourceAttribute |= (EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | EFI_RESOURCE_ATTRIBUTE_TESTED); } -- 2.29.2.windows.2