REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4337
This patch is to check SmBase relocation supported or not.
If gSmmBaseHobGuid found, means SmBase info has been relocated
and recorded in the SmBase array. ASSERT it's not supported in OVMF.
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zeng Star <star.zeng@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
/** @file\r
The CPU specific programming for PiSmmCpuDxeSmm module.\r
\r
/** @file\r
The CPU specific programming for PiSmmCpuDxeSmm module.\r
\r
- Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2023, Intel Corporation. All rights reserved.<BR>\r
\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
**/\r
\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
**/\r
#include <Library/SmmCpuFeaturesLib.h>\r
#include <Library/SmmServicesTableLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/SmmCpuFeaturesLib.h>\r
#include <Library/SmmServicesTableLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/HobLib.h>\r
#include <Pcd/CpuHotEjectData.h>\r
#include <PiSmm.h>\r
#include <Register/Intel/SmramSaveStateMap.h>\r
#include <Register/QemuSmramSaveStateMap.h>\r
#include <Pcd/CpuHotEjectData.h>\r
#include <PiSmm.h>\r
#include <Register/Intel/SmramSaveStateMap.h>\r
#include <Register/QemuSmramSaveStateMap.h>\r
+#include <Guid/SmmBaseHob.h>\r
\r
//\r
// EFER register LMA bit\r
\r
//\r
// EFER register LMA bit\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
+ //\r
+ // If gSmmBaseHobGuid found, means SmBase info has been relocated and recorded\r
+ // in the SmBase array. ASSERT it's not supported in OVMF.\r
+ //\r
+ ASSERT (GetFirstGuidHob (&gSmmBaseHobGuid) == NULL);\r
+\r
//\r
// No need to program SMRRs on our virtual platform.\r
//\r
//\r
// No need to program SMRRs on our virtual platform.\r
//\r
## @file\r
# The CPU specific programming for PiSmmCpuDxeSmm module.\r
#\r
## @file\r
# The CPU specific programming for PiSmmCpuDxeSmm module.\r
#\r
-# Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2023, Intel Corporation. All rights reserved.<BR>\r
#\r
# SPDX-License-Identifier: BSD-2-Clause-Patent\r
#\r
#\r
# SPDX-License-Identifier: BSD-2-Clause-Patent\r
#\r
SafeIntLib\r
SmmServicesTableLib\r
UefiBootServicesTableLib\r
SafeIntLib\r
SmmServicesTableLib\r
UefiBootServicesTableLib\r
+ HobLib\r
+\r
+[Guids]\r
+ gSmmBaseHobGuid ## CONSUMES\r
\r
[Pcd]\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber\r
\r
[Pcd]\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber\r