public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: Dun Tan <dun.tan@intel.com>
Cc: devel@edk2.groups.io, Jiewen Yao <jiewen.yao@intel.com>,
	 Gerd Hoffmann <kraxel@redhat.com>, Ray Ni <ray.ni@intel.com>,
	Jiaxin Wu <jiaxin.wu@intel.com>
Subject: Re: [edk2-devel] [PATCH 02/18] OvmfPkg: Save MTRR by lockbox in CpuS3DataDxe
Date: Mon, 20 May 2024 09:43:37 +0200	[thread overview]
Message-ID: <CAMj1kXHx_HKeHoBHm1Yh4mw=4aX3wjEn3PPQE2qZ-WsjYfveKg@mail.gmail.com> (raw)
In-Reply-To: <20240510100827.1903-3-dun.tan@intel.com>

On Fri, 10 May 2024 at 12:08, Dun Tan <dun.tan@intel.com> wrote:
>
> 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>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>


> ---
>  OvmfPkg/CpuS3DataDxe/CpuS3Data.c      | 11 +++++++++++
>  OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf |  2 ++
>  2 files changed, 13 insertions(+)
>
> diff --git a/OvmfPkg/CpuS3DataDxe/CpuS3Data.c b/OvmfPkg/CpuS3DataDxe/CpuS3Data.c
> index 289048b75d..d1aba32842 100644
> --- a/OvmfPkg/CpuS3DataDxe/CpuS3Data.c
> +++ b/OvmfPkg/CpuS3DataDxe/CpuS3Data.c
> @@ -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.
>    //
> diff --git a/OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf b/OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> index 228d5ae1b2..f5032a9222 100644
> --- a/OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> +++ b/OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> @@ -46,9 +46,11 @@
>    MtrrLib
>    UefiBootServicesTableLib
>    UefiDriverEntryPoint
> +  LockBoxLib
>
>  [Guids]
>    gEfiEndOfDxeEventGroupGuid         ## CONSUMES   ## Event
> +  gEdkiiS3MtrrSettingGuid
>
>  [Protocols]
>    gEfiMpServiceProtocolGuid          ## CONSUMES
> --
> 2.31.1.windows.1
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119077): https://edk2.groups.io/g/devel/message/119077
Mute This Topic: https://groups.io/mt/106018122/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2024-05-20  7:43 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10 10:08 [edk2-devel] [PATCH 00/19] Remove some S3 related code in CpuS3.c of smm cpu driver duntan
2024-05-10 10:08 ` [edk2-devel] [PATCH 01/18] MdeModulePkg: Add gEdkiiS3MtrrSettingGuid duntan
2024-05-13  2:07   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 02/18] OvmfPkg: Save MTRR by lockbox in CpuS3DataDxe duntan
2024-05-13  2:07   ` Ni, Ray
2024-05-20  7:43   ` Ard Biesheuvel [this message]
2024-05-10 10:08 ` [edk2-devel] [PATCH 03/18] UefiCpuPkg: Add locbox lib instance in DSC duntan
2024-05-13  2:07   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 04/18] UefiCpuPkg: Save MTRR by lockbox in CpuS3DataDxe duntan
2024-05-13  2:07   ` Ni, Ray
2024-05-13  3:04   ` Wu, Jiaxin
2024-05-13  3:37     ` duntan
2024-05-10 10:08 ` [edk2-devel] [PATCH 05/18] UefiCpuPkg: LoadMtrrData for all cpu in S3Resume duntan
2024-05-13  2:07   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 06/18] UefiCpuPkg: Remove the duplicated mpservice locate duntan
2024-05-13  2:07   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 07/18] UefiCpuPkg: Install gEdkiiEndOfS3ResumeGuid in S3Resume duntan
2024-05-10 10:08 ` [edk2-devel] [PATCH 08/18] UefiCpuPkg:Abstract some DxeMpLib code to function duntan
2024-05-13  2:13   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 09/18] UefiCpuPkg:Move some code in DxeMpLib to common place duntan
2024-05-13  2:16   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 10/18] UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib duntan
2024-05-13  2:23   ` Ni, Ray
2024-05-13 11:07   ` Gerd Hoffmann
2024-05-14  5:17     ` Ni, Ray
2024-05-14  6:51       ` Gerd Hoffmann
2024-05-10 10:08 ` [edk2-devel] [PATCH 11/18] UefiCpuPkg: Disable PG in IA32 ApLoopCode duntan
2024-05-13  2:25   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 12/18] UefiCpuPkg: Remove code to load mtrr setting duntan
2024-05-13  2:25   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 13/18] UefiCpuPkg:Set PcdCpuFeaturesInitOnS3Resume to TRUE duntan
2024-05-13  2:26   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 14/18] UefiCpuPkg: Remove code to set register table duntan
2024-05-13  2:26   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 15/18] UefiCpuPkg:Remove code to handle APIC setting and Interrupt duntan
2024-05-13  2:27   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 16/18] UefiCpuPkg:Remove code to wakeup AP and relocate ap duntan
2024-05-13  2:32   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 17/18] UefiCpuPkg: Remove GetAcpiCpuData() in CpuS3.c duntan
2024-05-13  2:33   ` Ni, Ray
2024-05-10 10:08 ` [edk2-devel] [PATCH 18/18] MdeModulePkg:Remove MpService2Ppi field in SMM_S3_RESUME_STATE duntan
2024-05-13  2:35   ` Ni, Ray
2024-05-13  3:38     ` duntan
2024-05-13  2:48 ` [edk2-devel] [PATCH 00/19] Remove some S3 related code in CpuS3.c of smm cpu driver Wu, Jiaxin
2024-05-13  3:37   ` duntan
2024-05-13  6:00     ` Ni, Ray

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='CAMj1kXHx_HKeHoBHm1Yh4mw=4aX3wjEn3PPQE2qZ-WsjYfveKg@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