[PATCH 08/14] OvmfPkg/PlatformPei: NoExec: stop using mPlatformInfoHob


Gerd Hoffmann
 

Stop using the mPlatformInfoHob global variable in NoexecDxeInitialization()
function. Pass a pointer to the PlatformInfoHob instead.

Signed-off-by: Gerd Hoffmann <kraxel@...>
---
OvmfPkg/PlatformPei/Platform.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index 85b47e7ed8df..7f3a26092626 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -75,16 +75,17 @@ MemMapInitialization (
ASSERT_RETURN_ERROR (PcdStatus);
}

+STATIC
VOID
NoexecDxeInitialization (
- VOID
+ IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob
)
{
RETURN_STATUS Status;

- Status = PlatformNoexecDxeInitialization (&mPlatformInfoHob);
+ Status = PlatformNoexecDxeInitialization (PlatformInfoHob);
if (!RETURN_ERROR (Status)) {
- Status = PcdSetBoolS (PcdSetNxForStack, mPlatformInfoHob.PcdSetNxForStack);
+ Status = PcdSetBoolS (PcdSetNxForStack, PlatformInfoHob->PcdSetNxForStack);
ASSERT_RETURN_ERROR (Status);
}
}
@@ -375,7 +376,7 @@ InitializePlatform (
PeiFvInitialization (&mPlatformInfoHob);
MemTypeInfoInitialization (&mPlatformInfoHob);
MemMapInitialization (&mPlatformInfoHob);
- NoexecDxeInitialization ();
+ NoexecDxeInitialization (&mPlatformInfoHob);
}

InstallClearCacheCallback ();
--
2.38.1