mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
OvmfPkg: Save MTRR by lockbox in CpuS3DataDxe
Save MTRR by lockbox in CpuS3DataDxe. In S3 boot, The MTRR setting will be restored in S3Resume.c in following patches. Then S3Resume.c will wakeup all APs to load the MTRR setting. This can avoid waking up APs in CpuS3.c. Signed-off-by: Dun Tan <dun.tan@intel.com> Reviewed-by: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
parent
87f22f4b5c
commit
52a4bc65f6
@ -9,7 +9,7 @@ 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 - 2021, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2013 - 2024, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2015 - 2020, Red Hat, Inc.
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
@ -26,6 +26,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/MtrrLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/LockBoxLib.h>
|
||||
|
||||
#include <Protocol/MpService.h>
|
||||
#include <Guid/EventGroup.h>
|
||||
@ -130,6 +131,16 @@ CpuS3DataOnEndOfDxe (
|
||||
DEBUG ((DEBUG_VERBOSE, "%a\n", __func__));
|
||||
MtrrGetAllMtrrs (&AcpiCpuDataEx->MtrrTable);
|
||||
|
||||
//
|
||||
// Save MTRR in lockbox
|
||||
//
|
||||
Status = SaveLockBox (
|
||||
&gEdkiiS3MtrrSettingGuid,
|
||||
&AcpiCpuDataEx->MtrrTable,
|
||||
sizeof (MTRR_SETTINGS)
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Close event, so it will not be invoked again.
|
||||
//
|
||||
|
@ -9,7 +9,7 @@
|
||||
# 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) 2013-2024, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2015-2020, Red Hat, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
@ -46,9 +46,11 @@
|
||||
MtrrLib
|
||||
UefiBootServicesTableLib
|
||||
UefiDriverEntryPoint
|
||||
LockBoxLib
|
||||
|
||||
[Guids]
|
||||
gEfiEndOfDxeEventGroupGuid ## CONSUMES ## Event
|
||||
gEdkiiS3MtrrSettingGuid
|
||||
|
||||
[Protocols]
|
||||
gEfiMpServiceProtocolGuid ## CONSUMES
|
||||
|
Loading…
x
Reference in New Issue
Block a user