From: "Ard Biesheuvel" <ard.biesheuvel@linaro.org>
To: Laszlo Ersek <lersek@redhat.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>,
"Igor Mammedov" <imammedo@redhat.com>,
"Jiewen Yao" <jiewen.yao@intel.com>,
"Jordan Justen" <jordan.l.justen@intel.com>,
"Michael Kinney" <michael.d.kinney@intel.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH v2 14/16] OvmfPkg: clone CpuS3DataDxe from UefiCpuPkg
Date: Mon, 2 Mar 2020 15:06:22 +0100 [thread overview]
Message-ID: <CAKv+Gu8+8hEPOUK5QA4daEsLK=iXLAbTNGSB5vgj6EAYXmRhxg@mail.gmail.com> (raw)
In-Reply-To: <20200226221156.29589-15-lersek@redhat.com>
On Wed, 26 Feb 2020 at 23:12, Laszlo Ersek <lersek@redhat.com> wrote:
>
> The @file comments in UefiCpuPkg/CpuS3DataDxe say,
>
> [...] It also only supports the number of CPUs reported by the MP
> Services Protocol, so this module does not support hot plug CPUs. This
> module can be copied into a CPU specific package and customized if these
> additional features are required. [...]
>
> The driver is so small that the simplest way to extend it with hotplug
> support is indeed to clone it at first. In this patch, customize the
> driver only with the following no-op steps:
>
> - Update copyright notices.
> - Update INF_VERSION to the latest INF spec version (1.29).
> - Update FILE_GUID.
> - Drop the UNI files.
> - Replace EFI_D_VERBOSE with DEBUG_VERBOSE, to appease "PatchCheck.py".
>
> This patch is best reviewed with:
>
> $ git show --find-copies-harder
>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Michael Kinney <michael.d.kinney@intel.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>
> Notes:
> v2:
>
> - Pick up Ard's Acked-by, which is conditional on approval from Intel
> reviewers on Cc. (I'd like to save Ard the churn of re-acking
> unmodified patches.)
>
> OvmfPkg/OvmfPkgIa32.dsc | 2 +-
> OvmfPkg/OvmfPkgIa32X64.dsc | 2 +-
> OvmfPkg/OvmfPkgX64.dsc | 2 +-
> OvmfPkg/OvmfPkgIa32.fdf | 2 +-
> OvmfPkg/OvmfPkgIa32X64.fdf | 2 +-
> OvmfPkg/OvmfPkgX64.fdf | 2 +-
> {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3DataDxe.inf | 10 +++-------
> {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3Data.c | 4 ++--
> 8 files changed, 11 insertions(+), 15 deletions(-)
>
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index 78310da44a5f..8d8ca746ba03 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -836,45 +836,45 @@ [Components]
> !endif
> HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
>
> <PcdsFixedAtBuild>
> gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
> gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
> }
>
> !if $(SECURE_BOOT_ENABLE) == TRUE
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
> !endif
>
> OvmfPkg/PlatformDxe/Platform.inf
> OvmfPkg/IoMmuDxe/IoMmuDxe.inf
>
> !if $(SMM_REQUIRE) == TRUE
> OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
> OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> - UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> + OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
>
> #
> # SMM Initial Program Load (a DXE_RUNTIME_DRIVER)
> #
> MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
>
> #
> # SMM_CORE
> #
> MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
>
> #
> # Privileged drivers (DXE_SMM_DRIVER modules)
> #
> OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf
> UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
> MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf {
> <LibraryClasses>
> LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.inf
> }
> UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf {
> <LibraryClasses>
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index 428578a4f839..acba1f80a431 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -850,45 +850,45 @@ [Components.X64]
> HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
>
> <PcdsFixedAtBuild>
> gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
> gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
> }
>
> !if $(SECURE_BOOT_ENABLE) == TRUE
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
> !endif
>
> OvmfPkg/PlatformDxe/Platform.inf
> OvmfPkg/AmdSevDxe/AmdSevDxe.inf
> OvmfPkg/IoMmuDxe/IoMmuDxe.inf
>
> !if $(SMM_REQUIRE) == TRUE
> OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
> OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> - UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> + OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
>
> #
> # SMM Initial Program Load (a DXE_RUNTIME_DRIVER)
> #
> MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
>
> #
> # SMM_CORE
> #
> MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
>
> #
> # Privileged drivers (DXE_SMM_DRIVER modules)
> #
> OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf
> UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
> MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf {
> <LibraryClasses>
> LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.inf
> }
> UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf {
> <LibraryClasses>
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index 73b92f259201..621b27f80d4b 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -848,45 +848,45 @@ [Components]
> HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
>
> <PcdsFixedAtBuild>
> gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
> gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
> }
>
> !if $(SECURE_BOOT_ENABLE) == TRUE
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
> !endif
>
> OvmfPkg/PlatformDxe/Platform.inf
> OvmfPkg/AmdSevDxe/AmdSevDxe.inf
> OvmfPkg/IoMmuDxe/IoMmuDxe.inf
>
> !if $(SMM_REQUIRE) == TRUE
> OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
> OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> - UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> + OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
>
> #
> # SMM Initial Program Load (a DXE_RUNTIME_DRIVER)
> #
> MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
>
> #
> # SMM_CORE
> #
> MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
>
> #
> # Privileged drivers (DXE_SMM_DRIVER modules)
> #
> OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf
> UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
> MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf {
> <LibraryClasses>
> LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.inf
> }
> UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf {
> <LibraryClasses>
> diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
> index 61b891765c56..004aa318b222 100644
> --- a/OvmfPkg/OvmfPkgIa32.fdf
> +++ b/OvmfPkg/OvmfPkgIa32.fdf
> @@ -298,45 +298,45 @@ [FV.DXEFV]
> INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
> INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
> INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
> INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
> INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
>
> !ifdef $(CSM_ENABLE)
> INF OvmfPkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf
> INF OvmfPkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
> INF RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf
> !else
> INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
> !endif
>
> INF OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf
> INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf
> INF OvmfPkg/PlatformDxe/Platform.inf
> INF OvmfPkg/IoMmuDxe/IoMmuDxe.inf
>
> !if $(SMM_REQUIRE) == TRUE
> INF OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
> INF OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> -INF UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> +INF OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> INF MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> INF MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
> INF OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf
> INF UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
> INF MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
> INF UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf
>
> #
> # Variable driver stack (SMM)
> #
> INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf
> INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
> INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
>
> !else
>
> #
> # Variable driver stack (non-SMM)
> #
> INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
> INF OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf
> diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
> index 501b4fcb7b67..13da8b9dbe65 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.fdf
> +++ b/OvmfPkg/OvmfPkgIa32X64.fdf
> @@ -305,45 +305,45 @@ [FV.DXEFV]
> INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
> INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
> INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
> INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
>
> !ifdef $(CSM_ENABLE)
> INF OvmfPkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf
> INF OvmfPkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
> INF RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf
> !else
> INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
> !endif
>
> INF OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf
> INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf
> INF OvmfPkg/PlatformDxe/Platform.inf
> INF OvmfPkg/AmdSevDxe/AmdSevDxe.inf
> INF OvmfPkg/IoMmuDxe/IoMmuDxe.inf
>
> !if $(SMM_REQUIRE) == TRUE
> INF OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
> INF OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> -INF UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> +INF OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> INF MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> INF MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
> INF OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf
> INF UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
> INF MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
> INF UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf
>
> #
> # Variable driver stack (SMM)
> #
> INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf
> INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
> INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
>
> !else
>
> #
> # Variable driver stack (non-SMM)
> #
> INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
> INF OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf
> diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
> index 501b4fcb7b67..13da8b9dbe65 100644
> --- a/OvmfPkg/OvmfPkgX64.fdf
> +++ b/OvmfPkg/OvmfPkgX64.fdf
> @@ -305,45 +305,45 @@ [FV.DXEFV]
> INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
> INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
> INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
> INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
>
> !ifdef $(CSM_ENABLE)
> INF OvmfPkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf
> INF OvmfPkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
> INF RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf
> !else
> INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
> !endif
>
> INF OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf
> INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf
> INF OvmfPkg/PlatformDxe/Platform.inf
> INF OvmfPkg/AmdSevDxe/AmdSevDxe.inf
> INF OvmfPkg/IoMmuDxe/IoMmuDxe.inf
>
> !if $(SMM_REQUIRE) == TRUE
> INF OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
> INF OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> -INF UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> +INF OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> INF MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> INF MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
> INF OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf
> INF UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
> INF MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
> INF UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf
>
> #
> # Variable driver stack (SMM)
> #
> INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf
> INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
> INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
>
> !else
>
> #
> # Variable driver stack (non-SMM)
> #
> INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
> INF OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf
> diff --git a/UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf b/OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> similarity index 83%
> copy from UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> copy to OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> index 510133a614ba..0ad8a0b35d25 100644
> --- a/UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> +++ b/OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> @@ -1,65 +1,61 @@
> ## @file
> # ACPI CPU Data initialization module
> #
> # This module initializes the ACPI_CPU_DATA structure and registers the address
> # of this structure in the PcdCpuS3DataAddress PCD. This is a generic/simple
> # version of this module. It does not provide a machine check handler or CPU
> # register initialization tables for ACPI S3 resume. It also only supports the
> # number of CPUs reported by the MP Services Protocol, so this module does not
> # support hot plug CPUs. This module can be copied into a CPU specific package
> # and customized if these additional features are required.
> #
> # Copyright (c) 2013-2016, Intel Corporation. All rights reserved.<BR>
> -# Copyright (c) 2015, Red Hat, Inc.
> +# Copyright (c) 2015-2020, Red Hat, Inc.
> #
> # SPDX-License-Identifier: BSD-2-Clause-Patent
> #
> ##
>
> [Defines]
> - INF_VERSION = 0x00010005
> + INF_VERSION = 1.29
> BASE_NAME = CpuS3DataDxe
> - MODULE_UNI_FILE = CpuS3DataDxe.uni
> - FILE_GUID = 4D2E57EE-0E3F-44DD-93C4-D3B57E96945D
> + FILE_GUID = 229B7EFD-DA02-46B9-93F4-E20C009F94E9
> MODULE_TYPE = DXE_DRIVER
> VERSION_STRING = 1.0
> ENTRY_POINT = CpuS3DataInitialize
>
> # The following information is for reference only and not required by the build
> # tools.
> #
> # VALID_ARCHITECTURES = IA32 X64
>
> [Sources]
> CpuS3Data.c
>
> [Packages]
> MdePkg/MdePkg.dec
> MdeModulePkg/MdeModulePkg.dec
> UefiCpuPkg/UefiCpuPkg.dec
>
> [LibraryClasses]
> UefiDriverEntryPoint
> UefiBootServicesTableLib
> BaseMemoryLib
> DebugLib
> BaseLib
> MtrrLib
> MemoryAllocationLib
>
> [Guids]
> gEfiEndOfDxeEventGroupGuid ## CONSUMES ## Event
>
> [Protocols]
> gEfiMpServiceProtocolGuid ## CONSUMES
>
> [Pcd]
> gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize ## CONSUMES
> gUefiCpuPkgTokenSpaceGuid.PcdCpuS3DataAddress ## PRODUCES
> gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable ## CONSUMES
>
> [Depex]
> gEfiMpServiceProtocolGuid
> -
> -[UserExtensions.TianoCore."ExtraFiles"]
> - CpuS3DataDxeExtra.uni
> diff --git a/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c b/OvmfPkg/CpuS3DataDxe/CpuS3Data.c
> similarity index 96%
> copy from UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
> copy to OvmfPkg/CpuS3DataDxe/CpuS3Data.c
> index 2be335d91903..2bb60d591b1e 100644
> --- a/UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
> +++ b/OvmfPkg/CpuS3DataDxe/CpuS3Data.c
> @@ -1,35 +1,35 @@
> /** @file
> ACPI CPU Data initialization module
>
> This module initializes the ACPI_CPU_DATA structure and registers the address
> of this structure in the PcdCpuS3DataAddress PCD. This is a generic/simple
> version of this module. It does not provide a machine check handler or CPU
> register initialization tables for ACPI S3 resume. It also only supports the
> number of CPUs reported by the MP Services Protocol, so this module does not
> support hot plug CPUs. This module can be copied into a CPU specific package
> and customized if these additional features are required.
>
> Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>
> -Copyright (c) 2015, Red Hat, Inc.
> +Copyright (c) 2015 - 2020, Red Hat, Inc.
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #include <PiDxe.h>
>
> #include <AcpiCpuData.h>
>
> #include <Library/BaseLib.h>
> #include <Library/BaseMemoryLib.h>
> #include <Library/UefiBootServicesTableLib.h>
> #include <Library/DebugLib.h>
> #include <Library/MtrrLib.h>
> #include <Library/MemoryAllocationLib.h>
>
> #include <Protocol/MpService.h>
> #include <Guid/EventGroup.h>
>
> //
> // Data structure used to allocate ACPI_CPU_DATA and its supporting structures
> //
> @@ -107,45 +107,45 @@ VOID
> EFIAPI
> CpuS3DataOnEndOfDxe (
> IN EFI_EVENT Event,
> OUT VOID *Context
> )
> {
> EFI_STATUS Status;
> ACPI_CPU_DATA_EX *AcpiCpuDataEx;
>
> AcpiCpuDataEx = (ACPI_CPU_DATA_EX *) Context;
> //
> // Allocate a 4KB reserved page below 1MB
> //
> AcpiCpuDataEx->AcpiCpuData.StartupVector = BASE_1MB - 1;
> Status = gBS->AllocatePages (
> AllocateMaxAddress,
> EfiReservedMemoryType,
> 1,
> &AcpiCpuDataEx->AcpiCpuData.StartupVector
> );
> ASSERT_EFI_ERROR (Status);
>
> - DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
> + DEBUG ((DEBUG_VERBOSE, "%a\n", __FUNCTION__));
> MtrrGetAllMtrrs (&AcpiCpuDataEx->MtrrTable);
>
> //
> // Close event, so it will not be invoked again.
> //
> gBS->CloseEvent (Event);
> }
>
> /**
> The entry function of the CpuS3Data driver.
>
> Allocate and initialize all fields of the ACPI_CPU_DATA structure except the
> MTRR settings. Register an event notification on gEfiEndOfDxeEventGroupGuid
> to capture the ACPI_CPU_DATA MTRR settings. The PcdCpuS3DataAddress is set
> to the address that ACPI_CPU_DATA is allocated at.
>
> @param[in] ImageHandle The firmware allocated handle for the EFI image.
> @param[in] SystemTable A pointer to the EFI System Table.
>
> @retval EFI_SUCCESS The entry point is executed successfully.
> @retval EFI_UNSUPPORTED Do not support ACPI S3.
> @retval other Some error occurs when executing this entry point.
> --
> 2.19.1.3.g30247aa5d201
>
>
next prev parent reply other threads:[~2020-03-02 14:06 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-26 22:11 [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE Laszlo Ersek
2020-02-26 22:11 ` [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure Laszlo Ersek
2020-03-02 12:47 ` [edk2-devel] " Laszlo Ersek
2020-03-02 12:55 ` Liming Gao
2020-03-02 13:46 ` Philippe Mathieu-Daudé
2020-03-03 0:46 ` Dong, Eric
2020-02-26 22:11 ` [PATCH v2 02/16] UefiCpuPkg/PiSmmCpuDxeSmm: fix S3 Resume for CPU hotplug Laszlo Ersek
2020-02-28 3:05 ` [edk2-devel] " Dong, Eric
2020-02-28 10:50 ` Laszlo Ersek
2020-03-04 12:23 ` Laszlo Ersek
2020-03-04 14:36 ` Dong, Eric
2020-02-26 22:11 ` [PATCH v2 03/16] OvmfPkg: clone SmmCpuPlatformHookLib from UefiCpuPkg Laszlo Ersek
2020-03-02 13:27 ` Ard Biesheuvel
2020-03-02 13:49 ` Philippe Mathieu-Daudé
2020-02-26 22:11 ` [PATCH v2 04/16] OvmfPkg: enable SMM Monarch Election in PiSmmCpuDxeSmm Laszlo Ersek
2020-03-02 13:32 ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 05/16] OvmfPkg: enable CPU hotplug support " Laszlo Ersek
2020-03-02 13:33 ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 06/16] OvmfPkg/CpuHotplugSmm: introduce skeleton for CPU Hotplug SMM driver Laszlo Ersek
2020-03-02 13:44 ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 07/16] OvmfPkg/CpuHotplugSmm: add hotplug register block helper functions Laszlo Ersek
2020-03-02 13:24 ` Philippe Mathieu-Daudé
2020-03-02 13:45 ` [edk2-devel] " Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 08/16] OvmfPkg/CpuHotplugSmm: define the QEMU_CPUHP_CMD_GET_ARCH_ID macro Laszlo Ersek
2020-03-02 13:22 ` Philippe Mathieu-Daudé
2020-03-02 13:45 ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 09/16] OvmfPkg/CpuHotplugSmm: add function for collecting CPUs with events Laszlo Ersek
2020-03-02 13:49 ` Ard Biesheuvel
2020-03-02 20:34 ` Philippe Mathieu-Daudé
2020-03-03 10:31 ` Laszlo Ersek
2020-02-26 22:11 ` [PATCH v2 10/16] OvmfPkg/CpuHotplugSmm: collect " Laszlo Ersek
2020-03-02 13:58 ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 11/16] OvmfPkg/CpuHotplugSmm: introduce Post-SMM Pen for hot-added CPUs Laszlo Ersek
2020-03-02 14:02 ` [edk2-devel] " Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 12/16] OvmfPkg/CpuHotplugSmm: introduce First SMI Handler " Laszlo Ersek
2020-03-02 14:03 ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 13/16] OvmfPkg/CpuHotplugSmm: complete root MMI handler for CPU hotplug Laszlo Ersek
2020-03-02 14:05 ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 14/16] OvmfPkg: clone CpuS3DataDxe from UefiCpuPkg Laszlo Ersek
2020-03-02 13:44 ` Philippe Mathieu-Daudé
2020-03-02 14:06 ` Ard Biesheuvel [this message]
2020-02-26 22:11 ` [PATCH v2 15/16] OvmfPkg/CpuS3DataDxe: superficial cleanups Laszlo Ersek
2020-03-02 13:25 ` Philippe Mathieu-Daudé
2020-03-02 14:06 ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 16/16] OvmfPkg/CpuS3DataDxe: enable S3 resume after CPU hotplug Laszlo Ersek
2020-03-02 14:16 ` Ard Biesheuvel
2020-03-02 15:46 ` [edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE Boris Ostrovsky
2020-03-02 19:22 ` Laszlo Ersek
2020-03-02 19:59 ` Laszlo Ersek
2020-03-04 13:29 ` Philippe Mathieu-Daudé
2020-03-04 18:09 ` Laszlo Ersek
2020-03-04 12:29 ` Laszlo Ersek
2020-03-05 8:32 ` Laszlo Ersek
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='CAKv+Gu8+8hEPOUK5QA4daEsLK=iXLAbTNGSB5vgj6EAYXmRhxg@mail.gmail.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