public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] MdeModulePkg/Gcd: Fix bug of attribute conversion
@ 2018-03-29  8:19 Heyi Guo
  2018-03-30  1:59 ` Zeng, Star
  2018-04-02  5:58 ` Zeng, Star
  0 siblings, 2 replies; 15+ messages in thread
From: Heyi Guo @ 2018-03-29  8:19 UTC (permalink / raw)
  To: edk2-devel
  Cc: Heyi Guo, Yi Li, Renhao Liang, Star Zeng, Eric Dong,
	Michael D Kinney, Liming Gao, Jian J Wang, Ruiyu Ni

For gDS->SetMemorySpaceAttributes(), when user passes a combined
memory attribute including CPU arch attribute and other attributes,
like EFI_MEMORY_RUNTIME, ConverToCpuArchAttributes() will return
INVALID_CPU_ARCH_ATTRIBUTES and skip setting page/cache attribute for
the specified memory space.

We don't see any reason to forbid combining CPU arch attributes and
non-CPU-arch attributes when calling gDS->SetMemorySpaceAttributes(),
so we remove the check code in ConverToCpuArchAttributes(); the
remaining code is enough to grab the interested bits for
Cpu->SetMemoryAttributes().

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Signed-off-by: Yi Li <phoenix.liyi@huawei.com>
Signed-off-by: Renhao Liang <liangrenhao@huawei.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
---
 MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
index 77f4adb4bc01..907245a3f512 100644
--- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
+++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
@@ -673,11 +673,6 @@ ConverToCpuArchAttributes (
 {
   UINT64      CpuArchAttributes;
 
-  if ((Attributes & ~(EXCLUSIVE_MEMORY_ATTRIBUTES |
-                      NONEXCLUSIVE_MEMORY_ATTRIBUTES)) != 0) {
-    return INVALID_CPU_ARCH_ATTRIBUTES;
-  }
-
   CpuArchAttributes = Attributes & NONEXCLUSIVE_MEMORY_ATTRIBUTES;
 
   if ( (Attributes & EFI_MEMORY_UC) == EFI_MEMORY_UC) {
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-04-04  1:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-29  8:19 [PATCH 1/1] MdeModulePkg/Gcd: Fix bug of attribute conversion Heyi Guo
2018-03-30  1:59 ` Zeng, Star
2018-04-02  5:58 ` Zeng, Star
2018-04-02 21:43   ` Kinney, Michael D
2018-04-03  0:59     ` Zeng, Star
2018-04-03  1:15       ` Zeng, Star
2018-04-03  1:24         ` Wang, Jian J
2018-04-03  2:25           ` Yao, Jiewen
2018-04-03  2:33             ` Zeng, Star
2018-04-03  2:34               ` Yao, Jiewen
2018-04-03  2:41                 ` Zeng, Star
2018-04-03  6:06                   ` Yao, Jiewen
2018-04-03 21:45                 ` Kinney, Michael D
2018-04-04  0:38                   ` Zeng, Star
2018-04-04  1:12             ` Guo Heyi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox