From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01a.ixn.mail.zen.net.uk (smarthost01a.ixn.mail.zen.net.uk [212.23.1.20]) by mx.groups.io with SMTP id smtpd.web11.10468.1644602149823041675 for ; Fri, 11 Feb 2022 09:55:50 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 sdn.klaviyomail.com}: permanent DNS error (domain: starlabs.systems, ip: 212.23.1.20, mailfrom: sean@starlabs.systems) Received: from [217.155.46.38] (helo=sean-StarBook.lan) by smarthost01a.ixn.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1nIa94-0000Ti-BE; Fri, 11 Feb 2022 17:55:46 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: guo.dong@intel.com, Sean Rhodes , Hao A Wu , Liming Gao Subject: [PATCH 2/2] MdeModulePkg/FaultTolerantWrite: Don't check for block alignment Date: Fri, 11 Feb 2022 17:55:44 +0000 Message-Id: <0cc5e6555e898ff6bd9c753aa7892e39e97373e1.1644602106.git.sean@starlabs.systems> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20c774e720e2d7f1bbc1a6bff73d752b624e9bba.1644602106.git.sean@starlabs.systems> References: <20c774e720e2d7f1bbc1a6bff73d752b624e9bba.1644602106.git.sean@starlabs.systems> MIME-Version: 1.0 X-Originating-smarthost01a-IP: [217.155.46.38] Feedback-ID: 217.155.46.38 Content-Transfer-Encoding: quoted-printable Don't check for block alignment as it will fail for devices that are memory= mapped. Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Sean Rhodes --- .../Universal/FaultTolerantWriteDxe/FtwMisc.c | 30 +------------------ 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c b/MdeMo= dulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c index 661e148767..b34b8f3561 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c @@ -1119,19 +1119,7 @@ FindFvbForFtw ( FtwDevice->WorkBlockSize =3D BlockSize;=0D FtwDevice->FtwWorkSpaceBase =3D (UINTN)(FtwDevice->WorkSpa= ceAddress - (FvbBaseAddress + FtwDevice->WorkBlockSize * (LbaIndex - 1)));= =0D FtwDevice->NumberOfWorkSpaceBlock =3D FTW_BLOCKS (FtwDevice->Ftw= WorkSpaceBase + FtwDevice->FtwWorkSpaceSize, FtwDevice->WorkBlockSize);=0D - if (FtwDevice->FtwWorkSpaceSize >=3D FtwDevice->WorkBlockSize) {= =0D - //=0D - // Check the alignment of work space address and length, they = should be block size aligned when work space size is larger than one block = size.=0D - //=0D - if (((FtwDevice->WorkSpaceAddress & (FtwDevice->WorkBlockSize = - 1)) !=3D 0) ||=0D - ((FtwDevice->WorkSpaceLength & (FtwDevice->WorkBlockSize -= 1)) !=3D 0))=0D - {=0D - DEBUG ((DEBUG_ERROR, "Ftw: Work space address or length is n= ot block size aligned when work space size is larger than one block size\n"= ));=0D - FreePool (HandleBuffer);=0D - ASSERT (FALSE);=0D - return EFI_ABORTED;=0D - }=0D - } else if ((FtwDevice->FtwWorkSpaceBase + FtwDevice->FtwWorkSpac= eSize) > FtwDevice->WorkBlockSize) {=0D + if ((FtwDevice->FtwWorkSpaceBase + FtwDevice->FtwWorkSpaceSize) = > FtwDevice->WorkBlockSize) {=0D DEBUG ((DEBUG_ERROR, "Ftw: The work space range should not spa= n blocks when work space size is less than one block size\n"));=0D FreePool (HandleBuffer);=0D ASSERT (FALSE);=0D @@ -1170,22 +1158,6 @@ FindFvbForFtw ( return EFI_ABORTED;=0D }=0D =0D - //=0D - // Check the alignment of spare area address and length, they sh= ould be block size aligned=0D - //=0D - if (((FtwDevice->SpareAreaAddress & (FtwDevice->SpareBlockSize -= 1)) !=3D 0) ||=0D - ((FtwDevice->SpareAreaLength & (FtwDevice->SpareBlockSize - = 1)) !=3D 0))=0D - {=0D - DEBUG ((DEBUG_ERROR, "Ftw: Spare area address or length is not= block size aligned\n"));=0D - FreePool (HandleBuffer);=0D - //=0D - // Report Status Code EFI_SW_EC_ABORTED.=0D - //=0D - REPORT_STATUS_CODE ((EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED), = (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_ABORTED));=0D - ASSERT (FALSE);=0D - CpuDeadLoop ();=0D - }=0D -=0D break;=0D }=0D }=0D --=20 2.32.0