From 7dbb8a24d1a3403f85d959bc1234b9f4a92bfbf0 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 2 Dec 2022 14:10:03 +0100 Subject: OvmfPkg/PlatformPei: NoExec: stop using mPlatformInfoHob Stop using the mPlatformInfoHob global variable in NoexecDxeInitialization() function. Pass a pointer to the PlatformInfoHob instead. Signed-off-by: Gerd Hoffmann Tested-by: Tom Lendacky Acked-by: Ard Biesheuvel --- OvmfPkg/PlatformPei/Platform.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OvmfPkg/PlatformPei/Platform.c') diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 85b47e7ed8..7f3a260926 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 (); -- cgit v1.2.3