From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx.groups.io with SMTP id smtpd.web11.2465.1629575785218150365 for ; Sat, 21 Aug 2021 12:56:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=ANvdvO6K; spf=pass (domain: posteo.de, ip: 185.67.36.65, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id A620B240028 for ; Sat, 21 Aug 2021 21:56:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1629575783; bh=s4Zls+ZyMQ+UG1Zo3iGKIAjsLy0AxB+Apjajys2yLyI=; h=From:To:Cc:Subject:Date:From; b=ANvdvO6KXbPbG/rXHbhLF/pSHn6b69WT2dhZjx9IlOvvdN+rtZKlCRpGgv66cojrG VB9QcpLuXhTb2FveTh70VjXAAWakS7OHQ21H+ljsjPSRYI8hqbhsa8IffhHieRCHam E2GUz5M0tT4d8uFcFfbpVWk+oHJltNvNlxRFGObtZB+cZLUHBUPhzv/EMiXZiSFrpE /hB3zpPHrAIx/A/8zeEcaDU9JWnLgJxw/joKwQ7129vsb++0zNy+f72EBgE0pvU2El 9fqGsqj0T0DbdBK0Btmjv7dQBn48O1DGpkTCQU7UzmaHJPCEeGmVqPmbXZ37O8Yg84 GeDsAOo4+5haA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GsTlp65sYz9rxM; Sat, 21 Aug 2021 21:56:22 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Dandan Bi , Liming Gao , Debkumar De , Harry Han , Catharine West , Vitaly Cheptsov Subject: [PATCH 1/5] MdeModulePkg/PeiCore: Align fixed-address error behaviour Date: Sat, 21 Aug 2021 19:55:47 +0000 Message-Id: <6baa44c6ee3ead5e4ffdefd5fdd3961323c323d0.1629575593.git.mhaeuser@posteo.de> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Update the control flow to take the same actions for failed fixed-address loading as if the feature was disabled. This primarily removes code duplication. Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Cc: Debkumar De Cc: Harry Han Cc: Catharine West Cc: Vitaly Cheptsov Signed-off-by: Marvin H=C3=A4user --- MdeModulePkg/Core/Pei/Image/Image.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Im= age/Image.c index 5af3895191a5..94adbed82e44 100644 --- a/MdeModulePkg/Core/Pei/Image/Image.c +++ b/MdeModulePkg/Core/Pei/Image/Image.c @@ -364,18 +364,18 @@ LoadAndRelocatePeCoffImage ( AlignImageSize +=3D ImageContext.SectionAlignment;=0D }=0D =0D + Status =3D EFI_UNSUPPORTED;=0D +=0D if (PcdGet64(PcdLoadModuleAtFixAddressEnable) !=3D 0 && (Private->HobL= ist.HandoffInformationTable->BootMode !=3D BOOT_ON_S3_RESUME)) {=0D Status =3D GetPeCoffImageFixLoadingAssignedAddress(&ImageContext, Pr= ivate);=0D if (EFI_ERROR (Status)){=0D DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED ERROR: Failed= to load module at fixed address. \n"));=0D - //=0D - // The PEIM is not assigned valid address, try to allocate page to= load it.=0D - //=0D - Status =3D PeiServicesAllocatePages (EfiBootServicesCode,=0D - EFI_SIZE_TO_PAGES ((UINT32) Ali= gnImageSize),=0D - &ImageContext.ImageAddress);=0D }=0D - } else {=0D + }=0D + if (EFI_ERROR (Status)){=0D + //=0D + // The PEIM is not assigned valid address, try to allocate page to l= oad it.=0D + //=0D Status =3D PeiServicesAllocatePages (EfiBootServicesCode,=0D EFI_SIZE_TO_PAGES ((UINT32) Align= ImageSize),=0D &ImageContext.ImageAddress);=0D --=20 2.31.1