public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gerd Hoffmann" <kraxel@redhat.com>
To: Min Xu <min.m.xu@intel.com>
Cc: devel@edk2.groups.io, Erdem Aktas <erdemaktas@google.com>,
	James Bottomley <jejb@linux.ibm.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Yuan Yu <yuanyu@google.com>
Subject: Re: [PATCH V4 0/2] Re-design CcProbeLib
Date: Mon, 29 Aug 2022 11:34:13 +0200	[thread overview]
Message-ID: <20220829093413.62723ertuipqh3zy@sirius.home.kraxel.org> (raw)
In-Reply-To: <cover.1661555091.git.min.m.xu@intel.com>

On Sat, Aug 27, 2022 at 07:07:06AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3974
> 
> CcProbeLib once was designed to probe the Confidential Computing guest
> type by checking the PcdOvmfWorkArea. But this memory is allocated with
> either EfiACPIMemoryNVS or EfiBootServicesData. It cannot be accessed
> after ExitBootService. Please see the detailed analysis in BZ#3974.
> 
> To fix this issue, CcProbeLib is re-designed as 2 implementation:
>  - SecPeiCcProbeLib
>  - DxeCcProbeLib
> 
> In SecPeiCcProbeLib we check the CC guest type by reading the
> PcdOvmfWorkArea. Because it is used in SEC / PEI and we don't worry about
> the issues in BZ#3974.
> 
> In DxeCcProbeLib we cache the GuestType in Ovmf work area in a global
> variable. 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.
> 
> The reason why we probe CC guest type in 2 different ways is the global
> varialbe. Global variable cannot be used in SEC/PEI and CcProbe is called
> very frequently.
> 
> Code: https://github.com/mxu9/edk2/tree/CcProbeLib.BZ3974.v4
> 
> v4 changes:
>  - Read Cc guest type in both DxeCcProbeLib's constructor and CcProbe. So
>    that we guarantee the Cc guest type is read early enough.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>

take care,
  Gerd


      parent reply	other threads:[~2022-08-29  9:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 23:07 [PATCH V4 0/2] Re-design CcProbeLib Min Xu
2022-08-26 23:07 ` [PATCH V4 1/2] OvmfPkg: Add SecPeiCcProbeLib Min Xu
2022-08-26 23:07 ` [PATCH V4 2/2] OvmfPkg: Update CcProbeLib to DxeCcProbeLib Min Xu
2022-08-29 13:36   ` Lendacky, Thomas
2022-08-29 23:57     ` Min Xu
2022-08-29  9:34 ` Gerd Hoffmann [this message]

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=20220829093413.62723ertuipqh3zy@sirius.home.kraxel.org \
    --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