VirtualBox

Ignore:
Timestamp:
Sep 11, 2019 8:46:37 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133262
Message:

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

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

Legend:

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

  • trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/PlatformPei/AmdSev.c

    r77662 r80721  
    44  Copyright (c) 2017, Advanced Micro Devices. All rights reserved.<BR>
    55
    6   This program and the accompanying materials
    7   are licensed and made available under the terms and conditions of the BSD
    8   License which accompanies this distribution.  The full text of the license
    9   may be found at http://opensource.org/licenses/bsd-license.php
    10 
    11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     6  SPDX-License-Identifier: BSD-2-Clause-Patent
    137
    148**/
     
    1610// The package level header files this module uses
    1711//
     12#include <Library/DebugLib.h>
     13#include <Library/HobLib.h>
     14#include <Library/MemEncryptSevLib.h>
     15#include <Library/PcdLib.h>
    1816#include <PiPei.h>
     17#include <Register/Amd/Cpuid.h>
     18#include <Register/Cpuid.h>
    1919
    20 #include <Library/DebugLib.h>
    21 #include <Library/PcdLib.h>
    22 #include <Register/Cpuid.h>
    23 #include <Register/Amd/Cpuid.h>
    24 #include <Library/MemEncryptSevLib.h>
     20#include "Platform.h"
    2521
    2622/**
     
    3127  **/
    3228VOID
    33 EFIAPI
    3429AmdSevInitialize (
    3530  VOID
     
    6762  PcdStatus = PcdSet32S (PcdOptionRomImageVerificationPolicy, 0x4);
    6863  ASSERT_RETURN_ERROR (PcdStatus);
     64
     65  //
     66  // When SMM is required, cover the pages containing the initial SMRAM Save
     67  // State Map with a memory allocation HOB:
     68  //
     69  // There's going to be a time interval between our decrypting those pages for
     70  // SMBASE relocation and re-encrypting the same pages after SMBASE
     71  // relocation. We shall ensure that the DXE phase stay away from those pages
     72  // until after re-encryption, in order to prevent an information leak to the
     73  // hypervisor.
     74  //
     75  if (FeaturePcdGet (PcdSmmSmramRequire) && (mBootMode != BOOT_ON_S3_RESUME)) {
     76    RETURN_STATUS LocateMapStatus;
     77    UINTN         MapPagesBase;
     78    UINTN         MapPagesCount;
     79
     80    LocateMapStatus = MemEncryptSevLocateInitialSmramSaveStateMapPages (
     81                        &MapPagesBase,
     82                        &MapPagesCount
     83                        );
     84    ASSERT_RETURN_ERROR (LocateMapStatus);
     85
     86    BuildMemoryAllocationHob (
     87      MapPagesBase,                      // BaseAddress
     88      EFI_PAGES_TO_SIZE (MapPagesCount), // Length
     89      EfiBootServicesData                // MemoryType
     90      );
     91  }
    6992}
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