26InstallProtocolInterfaces (
40 Status =
gBS->LocateDevicePath (
41 &gEfiFirmwareVolumeBlockProtocolGuid,
42 &FvbDevice->DevicePath,
45 if (EFI_ERROR (Status)) {
50 DEBUG ((DEBUG_INFO,
"Installing QEMU flash FVB\n"));
51 Status =
gBS->InstallMultipleProtocolInterfaces (
53 &gEfiFirmwareVolumeBlockProtocolGuid,
54 &FvbDevice->FwVolBlockInstance,
55 &gEfiDevicePathProtocolGuid,
56 FvbDevice->DevicePath,
64 Status =
gBS->HandleProtocol (
66 &gEfiFirmwareVolumeBlockProtocolGuid,
67 (VOID **)&OldFwbInterface
71 DEBUG ((DEBUG_INFO,
"Reinstalling FVB for QEMU flash region\n"));
72 Status =
gBS->ReinstallProtocolInterface (
74 &gEfiFirmwareVolumeBlockProtocolGuid,
76 &FvbDevice->FwVolBlockInstance
116 FwhInstance = mFvbModuleGlobal->FvInstance;
123 while (Index < mFvbModuleGlobal->NumFv) {
127 (
UINTN)((UINT8 *)FwhInstance) +
135 QemuFlashConvertPointers ();
139InstallVirtualAddressChangeHandler (
146 Status =
gBS->CreateEventEx (
149 FvbVirtualAddressChangeEvent,
151 &gEfiEventVirtualAddressChangeGuid,
152 &VirtualAddressChangeEvent
158MarkIoMemoryRangeForRuntimeAccess (
169 Status =
gDS->RemoveMemorySpace (
174 Status =
gDS->AddMemorySpace (
178 EFI_MEMORY_UC | EFI_MEMORY_RUNTIME
182 Status =
gDS->AllocateMemorySpace (
193 Status =
gDS->GetMemorySpaceDescriptor (BaseAddress, &GcdDescriptor);
196 Status =
gDS->SetMemorySpaceAttributes (
222SetPcdFlashNvStorageBaseAddresses (
226 RETURN_STATUS PcdStatus;
232 PcdFlashNvStorageVariableBase64,
237 PcdFlashNvStorageFtwWorkingBase,
238 PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase)
242 PcdFlashNvStorageFtwSpareBase,
243 PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase)
BOOLEAN EFIAPI IsDevicePathEnd(IN CONST VOID *Node)
VOID EFIAPI FvbVirtualAddressChangeEvent(IN EFI_EVENT Event, IN VOID *Context)
#define ASSERT_EFI_ERROR(StatusParameter)
#define ASSERT_RETURN_ERROR(StatusParameter)
#define DEBUG(Expression)
BOOLEAN EFIAPI MemEncryptSevIsEnabled(VOID)
RETURN_STATUS EFIAPI MemEncryptSevClearMmioPageEncMask(IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, IN UINTN NumPages)
#define PcdGet32(TokenName)
#define PcdSet64S(TokenName, Value)
#define PcdSet32S(TokenName, Value)
#define FeaturePcdGet(TokenName)
@ EfiGcdMemoryTypeMemoryMappedIo
UINT64 EFI_PHYSICAL_ADDRESS
#define EFI_SIZE_TO_PAGES(Size)
EFI_STATUS EFIAPI EfiConvertPointer(IN UINTN DebugDisposition, IN OUT VOID **Address)