Don't check for block alignment as it will fail for devices that are memory 
mapped.

Cc: Hao A Wu <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Sean Rhodes <[email protected]>
---
 .../Universal/FaultTolerantWriteDxe/FtwMisc.c | 30 +------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c 
b/MdeModulePkg/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          = BlockSize;
           FtwDevice->FtwWorkSpaceBase       = 
(UINTN)(FtwDevice->WorkSpaceAddress - (FvbBaseAddress + 
FtwDevice->WorkBlockSize * (LbaIndex - 1)));
           FtwDevice->NumberOfWorkSpaceBlock = FTW_BLOCKS 
(FtwDevice->FtwWorkSpaceBase + FtwDevice->FtwWorkSpaceSize, 
FtwDevice->WorkBlockSize);
-          if (FtwDevice->FtwWorkSpaceSize >= FtwDevice->WorkBlockSize) {
-            //
-            // 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.
-            //
-            if (((FtwDevice->WorkSpaceAddress & (FtwDevice->WorkBlockSize - 
1)) != 0) ||
-                ((FtwDevice->WorkSpaceLength & (FtwDevice->WorkBlockSize - 1)) 
!= 0))
-            {
-              DEBUG ((DEBUG_ERROR, "Ftw: Work space address or length is not 
block size aligned when work space size is larger than one block size\n"));
-              FreePool (HandleBuffer);
-              ASSERT (FALSE);
-              return EFI_ABORTED;
-            }
-          } else if ((FtwDevice->FtwWorkSpaceBase + 
FtwDevice->FtwWorkSpaceSize) > FtwDevice->WorkBlockSize) {
+          if ((FtwDevice->FtwWorkSpaceBase + FtwDevice->FtwWorkSpaceSize) > 
FtwDevice->WorkBlockSize) {
             DEBUG ((DEBUG_ERROR, "Ftw: The work space range should not span 
blocks when work space size is less than one block size\n"));
             FreePool (HandleBuffer);
             ASSERT (FALSE);
@@ -1170,22 +1158,6 @@ FindFvbForFtw (
             return EFI_ABORTED;
           }
 
-          //
-          // Check the alignment of spare area address and length, they should 
be block size aligned
-          //
-          if (((FtwDevice->SpareAreaAddress & (FtwDevice->SpareBlockSize - 1)) 
!= 0) ||
-              ((FtwDevice->SpareAreaLength & (FtwDevice->SpareBlockSize - 1)) 
!= 0))
-          {
-            DEBUG ((DEBUG_ERROR, "Ftw: Spare area address or length is not 
block size aligned\n"));
-            FreePool (HandleBuffer);
-            //
-            // Report Status Code EFI_SW_EC_ABORTED.
-            //
-            REPORT_STATUS_CODE ((EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED), 
(EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_ABORTED));
-            ASSERT (FALSE);
-            CpuDeadLoop ();
-          }
-
           break;
         }
       }
-- 
2.32.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#86622): https://edk2.groups.io/g/devel/message/86622
Mute This Topic: https://groups.io/mt/89077267/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to