audk/MdeModulePkg
Kinney, Michael D 0c9f2cb10b MdeModulePkg/Gcd: Filter gCpu->SetMemoryAttributes() calls
This patch fixes an issue with VlvTbltDevicePkg introduced
by commit 5b91bf82c6.

The history is as below.
To support heap guard feature, 14dde9e903
added support for SetMemorySpaceAttributes() to handle page attributes,
but after that, a combination of CPU arch attributes and other attributes
was not allowed anymore, for example, UC + RUNTIME. It is a regression.
Then 5b91bf82c6 was to fix the regression,
and we thought 0 CPU arch attributes may be used to clear CPU arch
attributes, so 0 CPU arch attributes was allowed to be sent to
gCpu->SetMemoryAttributes().

But some implementation of CPU driver may return error for 0 CPU arch
attributes. That fails the case that caller just calls
SetMemorySpaceAttributes() with none CPU arch attributes (for example,
RUNTIME), and the purpose of the case is not to clear CPU arch attributes.

This patch filters the call to gCpu->SetMemoryAttributes()
if the requested attributes is 0.  It also removes the #define
INVALID_CPU_ARCH_ATTRIBUTES that is no longer used.

Cc: Heyi Guo <heyi.guo@linaro.org>
Cc: Yi Li <phoenix.liyi@huawei.com>
Cc: Renhao Liang <liangrenhao@huawei.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@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>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2018-04-05 09:04:58 +08:00
..
Application MdeModulePkg/CapsuleApp: Center bitmap at bottom of screen 2018-03-21 20:55:27 -07:00
Bus MdeModulePkg/Usb: Replace macro USB_BOOT_IO_BLOCKS 2018-03-26 11:02:43 +08:00
Core MdeModulePkg/Gcd: Filter gCpu->SetMemoryAttributes() calls 2018-04-05 09:04:58 +08:00
Include MdeModulePkg SmmMemoryAttribute.h: Refine some comments 2018-04-04 10:43:33 +08:00
Library MdeModulePkg: Fix coding style issues in file/function comments 2018-03-19 09:57:22 +08:00
Logo MdeModulePkg/Logo.idf: Remove incorrect comments. 2018-02-28 15:30:23 +08:00
Universal MdeModulePkg/Variable/RuntimeDxe: introduce PcdMaxVolatileVariableSize 2018-03-30 21:17:07 +02:00
MdeModulePkg.dec MdeModulePkg/Variable/RuntimeDxe: introduce PcdMaxVolatileVariableSize 2018-03-30 21:17:07 +02:00
MdeModulePkg.dsc MdeModulePkg/DxeCapsuleLibFmp: Use BmpSupportLib 2018-02-11 16:05:15 -08:00
MdeModulePkg.uni MdeModulePkg/Variable/RuntimeDxe: introduce PcdMaxVolatileVariableSize 2018-03-30 21:17:07 +02:00
MdeModulePkgExtra.uni