From 2bb42f249fdd326be1f1d51a166450c7d9cdd154 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Tue, 5 Dec 2017 20:32:18 +0100
Subject: [PATCH 1/2] MdeModulePkg/Core/Dxe: log informative memprotect msgs at
DEBUG_INFO level
Message-id: <20171205193218.23531-2-lersek@redhat.com>
Patchwork-id: 78170
O-Subject: [RHEL-7.5 ovmf PATCH 1/1] MdeModulePkg/Core/Dxe: log informative
memprotect msgs at DEBUG_INFO level
Bugzilla: 1520485
Acked-by: Thomas Huth <thuth@redhat.com>
Acked-by: Andrew Jones <drjones@redhat.com>
In commit 7eb927db3e25 ("MdeModulePkg/DxeCore: implement memory protection
policy", 2017-02-24), we added two informative messages with the
InitializeDxeNxMemoryProtectionPolicy() function:
> InitializeDxeNxMemoryProtectionPolicy: applying strict permissions to
> active memory regions
and
> InitializeDxeNxMemoryProtectionPolicy: applying strict permissions to
> inactive memory regions
The messages don't report errors or warnings, thus downgrade their log
masks from DEBUG_ERROR to DEBUG_INFO.
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1520485
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
(cherry picked from commit a921228818b588b21fb26c26b2b72d066d251fe5)
---
MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
index a73c4cc..56d3171 100644
--- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
+++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
@@ -831,8 +831,11 @@ InitializeDxeNxMemoryProtectionPolicy (
} while (Status == EFI_BUFFER_TOO_SMALL);
ASSERT_EFI_ERROR (Status);
- DEBUG((DEBUG_ERROR, "%a: applying strict permissions to active memory regions\n",
- __FUNCTION__));
+ DEBUG ((
+ DEBUG_INFO,
+ "%a: applying strict permissions to active memory regions\n",
+ __FUNCTION__
+ ));
MergeMemoryMapForProtectionPolicy (MemoryMap, &MemoryMapSize, DescriptorSize);
@@ -856,9 +859,11 @@ InitializeDxeNxMemoryProtectionPolicy (
// accessible, but have not been added to the UEFI memory map (yet).
//
if (GetPermissionAttributeForMemoryType (EfiConventionalMemory) != 0) {
- DEBUG((DEBUG_ERROR,
+ DEBUG ((
+ DEBUG_INFO,
"%a: applying strict permissions to inactive memory regions\n",
- __FUNCTION__));
+ __FUNCTION__
+ ));
CoreAcquireGcdMemoryLock ();
--
1.8.3.1