public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Min Xu" <min.m.xu@intel.com>
To: Gerd Hoffmann <kraxel@redhat.com>,
	Tom Lendacky <thomas.lendacky@amd.com>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Aktas, Erdem" <erdemaktas@google.com>,
	James Bottomley <jejb@linux.ibm.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>
Subject: Re: [PATCH 1/1] OvmfPkg: Reserve the Ovmf work area as RT_DATA
Date: Tue, 23 Aug 2022 08:40:29 +0000	[thread overview]
Message-ID: <PH0PR11MB50646A2E7E22AC4CEF015567C5709@PH0PR11MB5064.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220823073759.qwcbpaohiqjnzrrh@sirius.home.kraxel.org>

On August 23, 2022 3:38 PM, Gerd Hoffmann wrote:
>   Hi,
> 
> > Ah, I forget to reserve the work-area as RT_Data in below code:
> >       BuildMemoryAllocationHob (
> >         (EFI_PHYSICAL_ADDRESS)(UINTN)FixedPcdGet32
> (PcdOvmfWorkAreaBase),
> >         (UINT64)(UINTN)FixedPcdGet32 (PcdOvmfWorkAreaSize),
> >         PlatformInfoHob->S3Supported ? EfiACPIMemoryNVS :
> EfiRuntimeServicesData  <-- ACPI_NVS is not accessible either in OS-Runtime.
> >         );
> >
> https://github.com/tianocore/edk2/blob/master/OvmfPkg/Library/Platform
> > InitLib/MemDetect.c#L1022-L1026
> 
> With that changed to use EfiRuntimeServicesData unconditionally the page
> fault is gone.
> 
> > Gerd, do you think we can reserve Ovmf WorkArea as RT_Data even when
> S3 is supported?
> 
> Hmm, not fully sure how the various memory types are handled when the
> VM is suspended.
> 
Tom suggested that the work area should not  be kept around. In stead a PCD should be used.
https://edk2.groups.io/g/devel/message/92617

But the dynamic PCD is not thread-safe and it cannot be accessed by APs. 

Now we have 2 solutions to fix this issue.
1. Reserve the Ovmf work area as RT_DATA.
2. Split the CcProbeLib into 2 instances. See https://edk2.groups.io/g/devel/message/91132

Gerd & Tom, what's your thought?

Thanks
Min


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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22  2:23 [PATCH 1/1] OvmfPkg: Reserve the Ovmf work area as RT_DATA Min Xu
2022-08-22  8:51 ` Gerd Hoffmann
2022-08-23  1:34   ` Min Xu
2022-08-23  7:37     ` Gerd Hoffmann
2022-08-23  8:40       ` Min Xu [this message]
2022-08-23 13:07         ` Lendacky, Thomas
2022-08-25  5:47           ` [edk2-devel] " Min Xu
2022-08-25  7:42             ` Gerd Hoffmann
2022-08-25  7:56               ` Min Xu
2022-08-25  8:15                 ` Gerd Hoffmann
2022-08-22 13:18 ` Lendacky, Thomas
2022-08-23  1:38   ` Min Xu

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=PH0PR11MB50646A2E7E22AC4CEF015567C5709@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