VirtualBox

Ignore:
Timestamp:
Mar 31, 2025 11:31:09 AM (5 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168237
Message:

Devices/EFI/FirmwareNew: Merge edk2-stable202502 from the vendor branch and make it build for the important platforms, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c

    r99404 r108794  
    4444  This driver need to make sure the CommBuffer is not in the SMRAM range.
    4545
    46 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
     46Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.<BR>
    4747SPDX-License-Identifier: BSD-2-Clause-Patent
    4848
     
    333333  CommBufferPayloadSize = TempCommBufferSize - SMM_FTW_COMMUNICATE_HEADER_SIZE;
    334334
    335   if (!FtwSmmIsBufferOutsideSmmValid ((UINTN)CommBuffer, TempCommBufferSize)) {
    336     DEBUG ((DEBUG_ERROR, "SmmFtwHandler: SMM communication buffer in SMRAM or overflow!\n"));
     335  if (!FtwSmmIsPrimaryBufferValid ((UINTN)CommBuffer, TempCommBufferSize)) {
     336    DEBUG ((DEBUG_ERROR, "SmmFtwHandler: SMM Primary(communication buffer) is not valid!\n"));
    337337    return EFI_SUCCESS;
    338338  }
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h

    r99404 r108794  
    33  The common header file for SMM FTW module and SMM FTW DXE Module.
    44
    5 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved. <BR>
     5Copyright (c) 2011 - 2024, Intel Corporation. All rights reserved. <BR>
    66SPDX-License-Identifier: BSD-2-Clause-Patent
    77
     
    8686
    8787/**
    88   This function checks if the buffer is valid per processor architecture and
    89   does not overlap with SMRAM.
     88  This function checks if the Primary Buffer is valid.
    9089
    9190  @param Buffer The buffer start address to be checked.
    9291  @param Length The buffer length to be checked.
    9392
    94   @retval TRUE  This buffer is valid per processor architecture and does not
    95                 overlap with SMRAM.
    96   @retval FALSE This buffer is not valid per processor architecture or overlaps
    97                 with SMRAM.
     93  @retval TRUE  This buffer is valid.
     94  @retval FALSE This buffer is not valid.
    9895**/
    9996BOOLEAN
    100 FtwSmmIsBufferOutsideSmmValid (
     97FtwSmmIsPrimaryBufferValid (
    10198  IN EFI_PHYSICAL_ADDRESS  Buffer,
    10299  IN UINT64                Length
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.c

    r99404 r108794  
    33  Parts of the SMM/MM implementation that are specific to standalone MM
    44
    5 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
     5Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.<BR>
    66Copyright (c) 2018, Linaro, Ltd. All rights reserved.<BR>
    77SPDX-License-Identifier: BSD-2-Clause-Patent
     
    1515
    1616/**
    17   This function checks if the buffer is valid per processor architecture and
    18   does not overlap with SMRAM.
     17  This function checks if the Primary Buffer is valid.
    1918
    2019  @param Buffer The buffer start address to be checked.
    2120  @param Length The buffer length to be checked.
    2221
    23   @retval TRUE  This buffer is valid per processor architecture and does not
    24                 overlap with SMRAM.
    25   @retval FALSE This buffer is not valid per processor architecture or overlaps
    26                 with SMRAM.
     22  @retval TRUE  This buffer is valid.
     23  @retval FALSE This buffer is not valid.
    2724**/
    2825BOOLEAN
    29 FtwSmmIsBufferOutsideSmmValid (
     26FtwSmmIsPrimaryBufferValid (
    3027  IN EFI_PHYSICAL_ADDRESS  Buffer,
    3128  IN UINT64                Length
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c

    r99404 r108794  
    33  Parts of the SMM/MM implementation that are specific to traditional MM
    44
    5 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved. <BR>
     5Copyright (c) 2011 - 2024, Intel Corporation. All rights reserved. <BR>
    66Copyright (c) 2018, Linaro, Ltd. All rights reserved. <BR>
    77SPDX-License-Identifier: BSD-2-Clause-Patent
     
    1515
    1616/**
    17   This function checks if the buffer is valid per processor architecture and
     17  This function checks if the Primary Buffer is valid per processor architecture and
    1818  does not overlap with SMRAM.
    1919
     
    2727**/
    2828BOOLEAN
    29 FtwSmmIsBufferOutsideSmmValid (
     29FtwSmmIsPrimaryBufferValid (
    3030  IN EFI_PHYSICAL_ADDRESS  Buffer,
    3131  IN UINT64                Length
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c

    r101291 r108794  
    811811  Offset          = sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER);
    812812
     813  if (!CompareGuid (&FtwWorkSpaceHeader->Signature, &gEdkiiWorkingBlockSignatureGuid)) {
     814    *FtwWriteHeader = FtwHeader;
     815    return EFI_ABORTED;
     816  }
     817
    813818  while (FtwHeader->Complete == FTW_VALID_STATE) {
    814819    Offset += FTW_WRITE_TOTAL_SIZE (FtwHeader->NumberOfWrites, FtwHeader->PrivateDataSize);
     
    816821    // If Offset exceed the FTW work space boudary, return error.
    817822    //
    818     if (Offset >= FtwWorkSpaceSize) {
     823
     824    if ((Offset + sizeof (EFI_FAULT_TOLERANT_WRITE_HEADER)) >= FtwWorkSpaceSize) {
    819825      *FtwWriteHeader = FtwHeader;
    820826      return EFI_ABORTED;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette