From 031adc2d42d144dda262285b73be61f1598dcc71 Mon Sep 17 00:00:00 2001 From: Mikhail Krichanov Date: Thu, 22 Feb 2024 11:23:22 +0300 Subject: [PATCH] Ring3: Small fix. --- .../Core/Dxe/SysCall/SupportedProtocols.c | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c b/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c index bf7f7b6200..0d93111f01 100644 --- a/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c +++ b/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c @@ -44,22 +44,26 @@ GoToRing3 ( VA_END (Marker); EnableSMAP (); - // - // Necessary fix for ProcessLibraryConstructorList() -> DxeCcProbeLibConstructor() - // - SetUefiImageMemoryAttributes ( - FixedPcdGet32 (PcdOvmfWorkAreaBase), - FixedPcdGet32 (PcdOvmfWorkAreaSize), - EFI_MEMORY_XP | EFI_MEMORY_USER - ); + if (Number == 2) { + // + // Necessary fix for ProcessLibraryConstructorList() -> DxeCcProbeLibConstructor() + // + SetUefiImageMemoryAttributes ( + FixedPcdGet32 (PcdOvmfWorkAreaBase), + FixedPcdGet32 (PcdOvmfWorkAreaSize), + EFI_MEMORY_XP | EFI_MEMORY_USER + ); + } Status = CallRing3 (Input); - SetUefiImageMemoryAttributes ( - FixedPcdGet32 (PcdOvmfWorkAreaBase), - FixedPcdGet32 (PcdOvmfWorkAreaSize), - EFI_MEMORY_XP - ); + if (Number == 2) { + SetUefiImageMemoryAttributes ( + FixedPcdGet32 (PcdOvmfWorkAreaBase), + FixedPcdGet32 (PcdOvmfWorkAreaSize), + EFI_MEMORY_XP + ); + } return Status; }