* [PATCH v2 0/2] UefiPayloadPkg: Keep reserved MMIO at runtime
@ 2022-04-11 2:46 akihiko.odaki
2022-04-11 2:46 ` [PATCH v2 1/2] MdeModulePkg: Set EFI_MEMORY_RUNTIME with GCD Akihiko Odaki
2022-04-11 2:46 ` [PATCH v2 2/2] UefiPayloadPkg: Keep reserved MMIO at runtime Akihiko Odaki
0 siblings, 2 replies; 4+ messages in thread
From: akihiko.odaki @ 2022-04-11 2:46 UTC (permalink / raw)
Cc: devel, Guo Dong, Jian J Wang, Liming Gao, Dandan Bi,
Michael D Kinney, Zhiguang Liu, Ray Ni, Maurice Ma, Benjamin You,
Akihiko Odaki
v2: Split changes for MdeModulePkg and UefiPayloadPkg (Dong, Guo)
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Akihiko Odaki (2):
MdeModulePkg: Set EFI_MEMORY_RUNTIME with GCD
UefiPayloadPkg: Keep reserved MMIO at runtime
MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 9 +++++++++
MdePkg/Include/Pi/PiHob.h | 2 ++
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 3 ++-
3 files changed, 13 insertions(+), 1 deletion(-)
--
2.35.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] MdeModulePkg: Set EFI_MEMORY_RUNTIME with GCD
2022-04-11 2:46 [PATCH v2 0/2] UefiPayloadPkg: Keep reserved MMIO at runtime akihiko.odaki
@ 2022-04-11 2:46 ` Akihiko Odaki
2022-04-11 2:46 ` [PATCH v2 2/2] UefiPayloadPkg: Keep reserved MMIO at runtime Akihiko Odaki
1 sibling, 0 replies; 4+ messages in thread
From: Akihiko Odaki @ 2022-04-11 2:46 UTC (permalink / raw)
Cc: devel, Guo Dong, Jian J Wang, Liming Gao, Dandan Bi,
Michael D Kinney, Zhiguang Liu, Ray Ni, Maurice Ma, Benjamin You,
Akihiko Odaki
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] UefiPayloadPkg: Keep reserved MMIO at runtime
2022-04-11 2:46 [PATCH v2 0/2] UefiPayloadPkg: Keep reserved MMIO at runtime akihiko.odaki
2022-04-11 2:46 ` [PATCH v2 1/2] MdeModulePkg: Set EFI_MEMORY_RUNTIME with GCD Akihiko Odaki
@ 2022-04-11 2:46 ` Akihiko Odaki
2022-04-14 19:04 ` Guo Dong
1 sibling, 1 reply; 4+ messages in thread
From: Akihiko Odaki @ 2022-04-11 2:46 UTC (permalink / raw)
Cc: devel, Guo Dong, Jian J Wang, Liming Gao, Dandan Bi,
Michael D Kinney, Zhiguang Liu, Ray Ni, Maurice Ma, Benjamin You,
Akihiko Odaki
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 0fed1e3691..a50f1c0271 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -74,7 +74,8 @@ MemInfoCallbackMmio (
EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;
+ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_RUNTIME;
BuildResourceDescriptorHob (Type, Attribue, (EFI_PHYSICAL_ADDRESS)Base, Size);
DEBUG ((DEBUG_INFO, "buildhob: base = 0x%lx, size = 0x%lx, type = 0x%x\n", Base, Size, Type));
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] UefiPayloadPkg: Keep reserved MMIO at runtime
2022-04-11 2:46 ` [PATCH v2 2/2] UefiPayloadPkg: Keep reserved MMIO at runtime Akihiko Odaki
@ 2022-04-14 19:04 ` Guo Dong
0 siblings, 0 replies; 4+ messages in thread
From: Guo Dong @ 2022-04-14 19:04 UTC (permalink / raw)
To: Akihiko Odaki
Cc: devel@edk2.groups.io, Wang, Jian J, Gao, Liming, Bi, Dandan,
Kinney, Michael D, Liu, Zhiguang, Ni, Ray, Ma, Maurice,
You, Benjamin
Reviewed-by: Guo Dong <guo.dong@intel.com>
-----Original Message-----
From: Akihiko Odaki <akihiko.odaki@gmail.com>
Sent: Sunday, April 10, 2022 7:47 PM
Cc: devel@edk2.groups.io; Dong, Guo <guo.dong@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Bi, Dandan <dandan.bi@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; Ni, Ray <ray.ni@intel.com>; Ma, Maurice <maurice.ma@intel.com>; You, Benjamin <benjamin.you@intel.com>; Akihiko Odaki <akihiko.odaki@gmail.com>
Subject: [PATCH v2 2/2] UefiPayloadPkg: Keep reserved MMIO at runtime
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 0fed1e3691..a50f1c0271 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -74,7 +74,8 @@ MemInfoCallbackMmio (
EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;
+ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_RUNTIME;
BuildResourceDescriptorHob (Type, Attribue, (EFI_PHYSICAL_ADDRESS)Base, Size);
DEBUG ((DEBUG_INFO, "buildhob: base = 0x%lx, size = 0x%lx, type = 0x%x\n", Base, Size, Type));
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-14 19:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-11 2:46 [PATCH v2 0/2] UefiPayloadPkg: Keep reserved MMIO at runtime akihiko.odaki
2022-04-11 2:46 ` [PATCH v2 1/2] MdeModulePkg: Set EFI_MEMORY_RUNTIME with GCD Akihiko Odaki
2022-04-11 2:46 ` [PATCH v2 2/2] UefiPayloadPkg: Keep reserved MMIO at runtime Akihiko Odaki
2022-04-14 19:04 ` Guo Dong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox