From: "Akihiko Odaki" <akihiko.odaki@gmail.com>
Cc: devel@edk2.groups.io, Guo Dong <guo.dong@intel.com>,
Jian J Wang <jian.j.wang@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
Dandan Bi <dandan.bi@intel.com>,
Michael D Kinney <michael.d.kinney@intel.com>,
Zhiguang Liu <zhiguang.liu@intel.com>, Ray Ni <ray.ni@intel.com>,
Maurice Ma <maurice.ma@intel.com>,
Benjamin You <benjamin.you@intel.com>,
Akihiko Odaki <akihiko.odaki@gmail.com>
Subject: [PATCH v2 1/2] MdeModulePkg: Set EFI_MEMORY_RUNTIME with GCD
Date: Mon, 11 Apr 2022 11:46:43 +0900 [thread overview]
Message-ID: <20220411024644.9698-2-akihiko.odaki@gmail.com> (raw)
In-Reply-To: <20220411024644.9698-1-akihiko.odaki@gmail.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 9 +++++++++
MdePkg/Include/Pi/PiHob.h | 2 ++
2 files changed, 11 insertions(+)
diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
index 3763467bdb..623b316c61 100644
--- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
+++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
@@ -2628,6 +2628,15 @@ CoreInitializeGcdServices (
ResourceHob->ResourceLength,
Capabilities
);
+
+ if (!EFI_ERROR (Status) &&
+ (ResourceHob->ResourceAttribute & EFI_RESOURCE_ATTRIBUTE_RUNTIME) == EFI_RESOURCE_ATTRIBUTE_RUNTIME) {
+ Status = CoreSetMemorySpaceAttributes(
+ ResourceHob->PhysicalStart,
+ ResourceHob->ResourceLength,
+ EFI_MEMORY_RUNTIME
+ );
+ }
}
if (GcdIoType != EfiGcdIoTypeNonExistent) {
diff --git a/MdePkg/Include/Pi/PiHob.h b/MdePkg/Include/Pi/PiHob.h
index e9f0ab4309..92bacbe62c 100644
--- a/MdePkg/Include/Pi/PiHob.h
+++ b/MdePkg/Include/Pi/PiHob.h
@@ -296,6 +296,8 @@ typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;
//
#define EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE 0x02000000
+#define EFI_RESOURCE_ATTRIBUTE_RUNTIME 0x04000000
+
///
/// Describes the resource properties of all fixed,
/// nonrelocatable resource ranges found on the processor
--
2.35.1
next prev parent reply other threads:[~2022-04-11 2:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-11 2:46 [PATCH v2 0/2] UefiPayloadPkg: Keep reserved MMIO at runtime akihiko.odaki
2022-04-11 2:46 ` Akihiko Odaki [this message]
2022-04-11 2:46 ` [PATCH v2 2/2] " Akihiko Odaki
2022-04-14 19:04 ` Guo Dong
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=20220411024644.9698-2-akihiko.odaki@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