public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Min Xu" <min.m.xu@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"kraxel@redhat.com" <kraxel@redhat.com>
Cc: "Aktas, Erdem" <erdemaktas@google.com>,
	James Bottomley <jejb@linux.ibm.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [edk2-devel] [PATCH V3 2/2] OvmfPkg: Update CcProbeLib to DxeCcProbeLib
Date: Fri, 26 Aug 2022 08:21:49 +0000	[thread overview]
Message-ID: <PH0PR11MB50640A67AA0E521D67EAE6F8C5759@PH0PR11MB5064.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220826052325.aiwch3qrbrnvj4mq@sirius.home.kraxel.org>

On August 26, 2022 1:23 PM, Gerd Hoffmann wrote:
>   Hi,
> 
> > In DxeCcProbeLib we cache the GuestType in Ovmf work area in first-call.
> > After that the Guest type is returned with the cached value. So that
> > we don't need to worry about the access to Ovmf work area after
> > ExitBootService.
> 
> This only works in case the first call is early enough.
> Better use a CONSTRUCTOR instead.
> 
Thanks for reminder.
There is another situation that the first call of DxeCcProbeLib is earlier than its CONSTRUCTOR.
For example, in MdeModulePkg/Core/Dxe/DxeMain, BaseDebugLibSerialPortConstructor is called before DxeCcProbeLibConstructor. While CcProbe () is called in BaseDebugLibSerialPortConstructor.
So I would like to read the Cc guest type in both CONSTRUCTOR and CcProbe.

ProcessLibraryConstructorList (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  )
{
  EFI_STATUS  Status;

  Status = BaseDebugLibSerialPortConstructor ();
  ASSERT_RETURN_ERROR (Status);

  Status = DxeCcProbeLibConstructor ();
  ASSERT_RETURN_ERROR (Status);
  ...
  ...
}

Thanks
Min

  reply	other threads:[~2022-08-26  8:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25 14:24 [PATCH V3 0/2] Re-design CcProbeLib Min Xu
2022-08-25 14:24 ` [PATCH V3 1/2] OvmfPkg: Add SecPeiCcProbeLib Min Xu
2022-08-25 14:24 ` [PATCH V3 2/2] OvmfPkg: Update CcProbeLib to DxeCcProbeLib Min Xu
2022-08-26  5:23   ` Gerd Hoffmann
2022-08-26  8:21     ` Min Xu [this message]
2022-08-26  9:11       ` [edk2-devel] " Gerd Hoffmann

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=PH0PR11MB50640A67AA0E521D67EAE6F8C5759@PH0PR11MB5064.namprd11.prod.outlook.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